| Név | Hoszt | Épület |
|---|---|---|
| Ádám | D-003-654 | SZI |
| Péter | N-001-123 | EZP |
| Imi | D-003-123 | LF |
| Feri | N-003-987 | LF |
| Közös | W-001-001 | SZI |
- function tablaSzureseMind(){
- table = document.getElementById("tabla");
- trs = table.getElementsByTagName("tr");
- inputs = table.getElementsByTagName("input");
- for (i = 0; i < trs.length; i++) {
- isSorRejt=false;//sort meg kell jeleníteni
- for(j = 0; j < inputs.length; j++){
- td = trs[i].getElementsByTagName("td")[j]; //vizsgált cella
- if (td) {
- txtValue = td.textContent || td.innerText;
- if ( !(txtValue.toUpperCase().indexOf(inputs[j].value.toUpperCase()) > -1) ) {
- isSorRejt=true;
- }
- }
- }
- if(isSorRejt){
- trs[i].style.display ="none";
- }else {
- trs[i].style.display ="";
- }
- }
- }
- <table id="tabla">
- <tr class="Szuro">
- <th><input type="text" id="nev" onkeyup="tablaSzureseMind()" placeholder="Név"></th>
- <th><input type="text" id="hoszt" onkeyup="tablaSzureseMind()" placeholder="Hoszt"></th>
- <th><input type="text" id="epulet" onkeyup="tablaSzureseMind()" placeholder="Hely"></th>
- </tr>
- <tr class="header">
- <th>Név</th>
- <th>Hoszt</th>
- <th>Épület</th>
- </tr>
- <tr>
- <td>Ádám</td>
- <td bgcolor="green">D-003-654</td>
- <td>SZI</td>
- </tr>