The user inputs some text into a form and its stored in a variable 'userInput'
I have html table with id="myTable".
I want to iterate through the table using Javascript and delete all the rows where the value of the 3rd column in a row isn't equal to the userInput, but my code isn't working for some reason:
var theTable = document.getElementById("myTable");
for(int x = 0; x < theTable.rows.length; x++){
if(theTable.rows[x].cells[2].innerHTML != userInput){
theTable.deleteRow(x);
}
}