I have two drop-down menus, and I would like to filter the list based on the values from the menu. I tried searching through the web, but most of the answers included jQuery. Is it possible to do this with pure JavaScript? Please don't just give the answer, I really want to learn how you came up with the answer. Thanks in advance.
HTML:
xhr.onreadystatechange = function(){
if(xhr.readyState == 4){
var leftDisplay = document.getElementById('questions');
var rightDisplay = document.getElementById('test');
var res=xhr.responseText;
var data=JSON.parse(res);
var len=data.length;
length=len;
console.log(data);
var lefthtml="<div class='row'>";
lefthtml+="<div class='col-md-12'>";
lefthtml+="<table id='qTable'>";
lefthtml+="<thead style='background-color:#0d365e; color:white;'><tr><th>Check</th>";
lefthtml+='<th width="1000">Question</th>';
lefthtml+='<th width="100">Type</th>';
lefthtml+='<th width="100">Difficulty</th>';
lefthtml+= "<center><input type='text' id='myInput' onkeyup='Search()' placeholder='Search..'>";
lefthtml+="<select id= 'type'>";
lefthtml+="<option value=''>type...</option>";
lefthtml+="<option value='method'>method</option>";
lefthtml+="<option value='for'>for</option>";
lefthtml+="<option value='multiple'>multiple</option>";
lefthtml+="<option value='while'>while</option>";
lefthtml+="</select>"
lefthtml+="<select id= 'difficulty'>";
lefthtml+="<option value=''>difficulty...</option>";
lefthtml+="<option value='easy'>easy</option>";
lefthtml+="<option value='medium'>medium</option>";
lefthtml+="<option value='hard'>hard</option>";
lefthtml+="</select></center><br><br>"
lefthtml+="</tr></thead>";
lefthtml+="<tbody>";
var righthtml ='<div>';
righthtml+='<div>';
righthtml+="<table class='table table-striped'>";
righthtml+="<thead style='background-color:#0d365e; color:white;'><tr>";
righthtml+='<th width="200">Check</th>';
righthtml+='<th width="1000">Question</th>';
righthtml+="<th style='width:25%;'>Points</th></tr>";
righthtml+='</thead><tbody>';
var pointsTotal;
for(var i=0;i<len;i++){
LeftArr.push(data[i]['id']);
RightArr.push("test"+data[i]['id']);
points.push("points"+data[i]['id']);
lefthtml+="<tr><td>";
lefthtml+='<input type="checkbox" name="questionlist" id="'+data[i]['id'];
lefthtml+='" value="'+data[i]['id']+'"'+'></td>';
lefthtml+='<td><br>'+data[i]['question']+'</td>';
lefthtml+='<td><br>'+data[i]['type']+'</td>';
lefthtml+='<td><br>'+data[i]['difficulty']+'</td>';
lefthtml+='</tr>';
righthtml+="<tr hidden id='"+"tr"+data[i]['id']+"'><td>";
righthtml+='<input type="checkbox" name="testlist" id="'+"test"+ data[i]['id'];
righthtml+='"value="'+data[i]['id']+'"'+'></td>';
righthtml+='<td width="200px"><br>'+data[i]['question']+'</td>';
righthtml+='<td><input type="text"';
righthtml+='id="'+points[i]+'" name="point" onkeyup="findTotal()"';
righthtml+='placeholder="Input Points" style="border:none;width:100%;"/></td>';
righthtml+='</tr>';
}
lefthtml+="</tbody></table>";
lefthtml+="</div></div>";
righthtml+="</tbody></table>";
righthtml+='</div></div>';
righthtml+= '<center>total: <input type="text" name="total" onkeyup="findTotal()" id="total" readonly/> </center>';
leftDisplay.innerHTML=lefthtml;
rightDisplay.innerHTML=righthtml;
}
}

lefthtml+=?