我需要将工具提示插件应用到页面上的一堆不同元素。与 jQuery 选择器一起使用的唯一共同属性是它们都有一个 title
属性集。
我尝试使用 $('[title=*]')
作为选择器,但这不起作用。
最佳答案
简单地说:
$('[title]')
另请参阅 - Has Attribute Selector :
Selects elements that have the specified attribute, with any value.
关于jQuery 选择所有有标题的元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3036106/