31 lines
998 B
JavaScript
31 lines
998 B
JavaScript
function tableSearch(own_elem, tableID, rowsearch=0) {
|
|
var table, input, tr, td, row_content;
|
|
table = document.getElementById(tableID);
|
|
input = document.getElementById(own_elem).value.toUpperCase();
|
|
tr = table.getElementsByTagName("tr");
|
|
|
|
for (let i = 0; i < tr.length; i++) {
|
|
td = tr[i].getElementsByTagName("td")[rowsearch];
|
|
if(td){
|
|
row_content = td.textContent || td.innerText;
|
|
if (row_content.toUpperCase().indexOf(input) > -1) {
|
|
tr[i].style.display = "";
|
|
}
|
|
else{
|
|
tr[i].style.display ="none";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function toggleRoomDropdown() {
|
|
document.getElementById("rooms-unrolled").style.display = "inline";
|
|
document.getElementById("rooms-rolled").style.display = "none";
|
|
|
|
}
|
|
|
|
function untoggleRoomDropdown() {
|
|
document.getElementById("rooms-rolled").style.display = "inline";
|
|
document.getElementById("rooms-unrolled").style.display = "none";
|
|
}
|