six javascript codes and each code containing the desired number of corresponding td such as (td = tr.getElementsByTagName("td")[0]
(td = tr.getElementsByTagName("td")[1]
только с одним входным ящиком вместо шести входных ящиков, но с вариантом, чтобы ввести желаемый номер TD ** [0] **, [1], < /strong> [2] < /strong>, и т. Д. и т. Д. и т. Д., Чтобы отфильтровать данные
только от TD. Спасибо < /p>
Total/Searched:
Name
Country
City
Street
House No
Neighbour
Mario Resende
Argentina
Buenos Aires
Belgrano Calle
2:3
Cristina Rodriguez
Philips Douglas
United Kingdom
London
Oxford Avenue
17:25
Sophie Loren
Ramesh Bugatapa
India
New Delhi
Golochand road
1:2
Kiran Johr
function filterTable() {
var input, filter, table, tr, td, i, txtValue;
input = document.getElementById("myInput");
filter = input.value.toUpperCase();
table = document.getElementById("myTable");
tr = table.getElementsByTagName("tr");
rowsFound =[];
for (i = 0; i < tr.length; i++) {
td = tr.getElementsByTagName("td")[4];
if (td) {
txtValue = td.textContent || td.innerText;
// EDIT Check for match at beginning of string
// if (txtValue.toUpperCase().indexOf(filter) > -1) {
if (txtValue.toUpperCase().indexOf(filter) == 0) {
tr.style.display = "";
rowsFound.push(1)
} else {
tr.style.display = "none";
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/797 ... t-box-only