Bộ lọc HTML W3.JS
Các phần tử lọc:
w3.filterHTML(selector)
Lọc danh sách
Tìm kiếm tên trong trường nhập.
- {{Tên khách hàng}}
Thí dụ
<input oninput="w3.filterHTML('#id01',
'li', this.value)">
<ul id="id01">
<li>Alfreds Futterkiste</li>
<li>Berglunds snabbkop</li>
...
Bàn lọc
Tên | Quốc gia |
---|---|
Siêu thị của Berglund | Thụy Điển |
Bắc Nam | Vương quốc Anh |
Hộp thức ăn của Alfred | nước Đức |
Thức ăn hoàng gia | nước Đức |
Kho lương thực thu thập | Nước Ý |
Đặc sản Paris | Nước pháp |
Island Trading | Vương quốc Anh |
Bacchus Winecellars cười | Canada |
Thí dụ
<input oninput="w3.filterHTML('#id01', '.item', this.value)">
<table
id="id01">
<tr>
<th>Customer</th>
<th>City</th>
<th>Country</th>
</tr>
<tr class="item">
<td>Alfreds Futterkiste</td>
<td>Berlin</td>
<td>Germany</td>
</tr>
<tr class="item">
<td>Berglunds snabbkop</td>
<td>Lulea</td>
<td>Sweden</td>
</tr>
...