I am new to all of this and need some help. I would like to get to work "nth:child(even)" right while i am using my filter. Big part of my JavaScript-Code is from w3schools
// Declare variables
var input, filter, table, tr, td, i, txtValue;
input = document.getElementById("myInput");
filter = input.value.toUpperCase();
table = document.getElementById("myTable");
tr = table.getElementsByTagName("tr");
// Loop through all table rows, and hide those who dont match the search query
for (i = 0; i < tr.length; i++) {
tdArray = tr[i].getElementsByTagName("td");
for (n = 0; n < tdArray.length; n++) {
td = tdArray[n];
if (td) {
txtValue = td.textContent || td.innerText;
if (txtValue.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = "";
break;
} else {
tr[i].style.display = "none";
}
}
}
}
}
.row_zarmlistitem:nth-child(even) {
background: #e8ecf1;
<table class="table_list" id="myTable">
<tr class="mobilesort_list">
<th class="cursor_list header1_position_list name_list" onclick="sortTable(0)">Name ⇅</th>
<th class="cursor_list header2_position_list firstname_list" onclick="sortTable(1)">First Name ⇅</th>
<th class="head_list title_list">Title</th>
<th class="cursor_list header3_position_list" onclick="sortTable(3)">Department ⇅</th>
<th class="head_list phone_list">+49 421 218-</th>
<th class="head_list room_list">Building, Room</th>
<th class="head_list">Email Address</th>
<th class="head_list">Information</th>
</tr>
<f:for each="{addresses}" as="address" iteration="iterator" reverse="1">
<f:render partial="ZarmListItem" arguments="{_all}"/>
</f:for>
</table>
First time working with JavaScript and also never worked with jquery or something else but i would love some help from you guys!