如何使用id的一部分在jquery中获取表id? [英] how to get table id in jquery using part of id?
本文介绍了如何使用id的一部分在jquery中获取表id?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的表名以tbl_5开头(某个值)...如何使用jquery获取表id,部分表名为tbl _ ?????
解决方案
< blockquote>使用属性从选择器开始[name ^ =value] [ ^ ]
在上面Tadit dash solutoin ..
你可以查看这个链接 http://api.jquery.com/category/selectors/ [ ^ ]所有可能的选择器
你可以选择哪一个适合你的需要。
我更喜欢以下选择器供您选择。
http://api.jquery.com/attribute-contains -selector / [ ^ ]
http://api.jquery.com/attribute-starts-with-selector/ [ ^ ]
I have table name starting with tbl_5 (some value)... how to get table id using jquery with part of table name tbl_?????
解决方案
Use Attribute Starts With Selector [name^="value"][^]
on top of Tadit dash solutoin..
you can have a look at this link http://api.jquery.com/category/selectors/[^] for all possible selectors
and you can choose which one suits for your need.
I would prefer below selectors for your need.
http://api.jquery.com/attribute-contains-selector/[^]
http://api.jquery.com/attribute-starts-with-selector/[^]
这篇关于如何使用id的一部分在jquery中获取表id?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文