Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function search() {
- var input, filter, found, table, tr, td, i, j;
- input = document.getElementById("myInput");
- filter = input.value.toUpperCase();
- table = document.getElementById("myTable");
- table.style.display = "block";
- tr = table.getElementsByTagName("tr");
- for (i = 0; i < tr.length; i++) {
- td = tr[i].getElementsByTagName("td");
- for (j = 0; j < td.length; j++) {
- if (td[j].innerHTML.toUpperCase().indexOf(filter) > -1) {
- found = true;
- }
- }
- if (found) {
- tr[i].style.display = "";
- found = false;
- } else if (!tr[i].id.match('^tableHeader')) {
- tr[i].style.display = "none";
- }
- }
- <table id="myTable">
- <tr>
- {% for key, value in list.items() %}
- <td>{{ key|e }</td>
- <td id="name">{{ value|e }}</td>
- <td>
- <form class="form-signin ajax" action="/signIn" method="post" data-replace="#res" role="form">
- <input type="checkbox" name="watchlist" value="Watchlist" onclick="writeToCell (this.id)" id="{{ key|e }}">
- </form>
- </td>
- </tr>
- {% endfor %}
- </table>
Add Comment
Please, Sign In to add comment