search functionality for html table
BY LOVE SINGH,
Call this function onKeyUp event of TEXTBOX.
function myFunction() {
var input, filter, table, tr, td, i;
input = document.getElementById("TextBoxID");
filter = input.value.toUpperCase();
table = document.getElementById("TableID");
tr = table.getElementsByTagName("tr");
for (i = 0; i < tr.length; i++) {
td = tr[i].getElementsByTagName("td")[1];
var x = $("#TextBoxID").val();
var regex = /^[a-zA-Z]+$/;
if (!x.match(regex)) {
td = tr[i].getElementsByTagName("td")[0];
}
if (td) {
if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = "";
} else {
tr[i].style.display = "none";
}
}
}
}
Also in HTML:
- how to make a login page in html
- psd to html
- html bold text
- meta viewport
- variables in html
- html link in new tab
- ul li html
- guess the number game js
- ionic progress bar
- background position in html
- Finding HTML Elements
- div html
- how to add a paragraph in html
- how to add icon in html
- how to do input in html
- html telephone
- hover over something to make html visible
- login with laravel
- bootstrap 4 checkbox
- html sticky touch hover
- canvas tag html
- </a>
- scrapy get raw html content of selector innerhtml
- how to add an image in html