Piotr Czajkowski 5 жил өмнө
parent
commit
50db6dd534
1 өөрчлөгдсөн 10 нэмэгдсэн , 0 устгасан
  1. 10 0
      html/results.html

+ 10 - 0
html/results.html

@@ -32,12 +32,22 @@
 					}
 				}
 			};
+
+			let clearFilter = function() {
+				let table = document.getElementsByTagName("tbody")[0];
+				let tr = table.getElementsByTagName("tr");
+
+				for (let i = 0; i < tr.length; i++) {
+					tr[i].style.display = "";
+				}
+			};
 		</script>
 	</head>
 	<body>
 		<a href="/">Search again</a>
 		<div>Filter: 
 			<input type="text" name="name" onchange="filterTable(this.value)" autocomplete="off">
+			<button class="btn" onclick="clearFilter()">Clear</button>
 		</div>
 		<table>
 			<thead>