javascript - jQuery 选择所有 id 以开头的表

标签 javascript html jquery jquery-events

我想用 jQuery 选择 id 以同一句话开头的所有表。

我的意思是:

<table id="Tab_01">
    <tr>
        <td>....
    <tr>
    ....
</table>

<table id="Tab_02">
    <tr>
        <td>....
    <tr>
    ....
</table>
<table id="Tab_03">
    <tr>
        <td>....
    <tr>
    ....
</table>
<table id="xyz">
    <tr>
        <td>....
    <tr>
    ....
</table>

我需要的是选择以 "Tab_" 开头的表,而不是 id = "xyz"

的表

我想使用此代码通过此插件进行类似的导航: http://projects.allmarkedup.com/jquery_evtpaginate/demo_basic.html

谁能帮帮我?

最佳答案

试试这个:

$('table[id^=Tab_]')

关于javascript - jQuery 选择所有 id 以开头的表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3513569/

相关文章:

javascript - 显示内容 Jquery

javascript - 如何重写 forEach 以使用 Promises 停止 "freezing"浏览器?

javascript - td 在表格中单击时如何获取值

javascript - 使用 nth-child 和 :after pseudo using jQuery 修改 css 类

javascript - 无需鼠标弹起即可识别长按

javascript - 如何从 getDataRange() 中排除标题行?

javascript - 使用 javascript 从本地主机 Web 服务保存 json 数据

java - 帮助使用正则表达式解析并获取 html 中 <p> 标记的内容

html - 如何在WordPress中的weglot插件下拉按钮中获得圆 Angular 边框?

javascript - 在 Jquery 中定位图像