Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
     ❯   

W3.JS HTML 过滤器


过滤元素

w3.filterHTML(selector)

过滤列表

在输入字段中搜索名称。

  • {{CustomerName}}

示例

<input oninput="w3.filterHTML('#id01', 'li', this.value)">

<ul id="id01">
  <li>Alfreds Futterkiste</li>
  <li>Berglunds snabbkop</li>
...
亲自试一试 » 带 CSS »

过滤表格

名称 国家
Berglunds snabbköp 瑞典
北/南 英国
Alfreds Futterkiste 德国
Königlich Essen 德国
Magazzini Alimentari Riuniti 意大利
Paris spécialités 法国
Island Trading 英国
Laughing Bacchus Winecellars 加拿大

示例

<input oninput="w3.filterHTML('#id01', '.item', this.value)">

<table id="id01">
  <tr>
    <th>客户</th>
    <th>城市</th>
    <th>国家</th>
  </tr>
  <tr class="item">
    <td>Alfreds Futterkiste</td>
    <td>柏林</td>
    <td>德国</td>
  </tr>
  <tr class="item">
    <td>Berglunds snabbkop</td>
    <td>吕勒奥</td>
    <td>瑞典</td>
  </tr>
...
亲自试一试 » 带 CSS »

×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
[email protected]

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
[email protected]

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2024 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.