How can I find all elements that have a title attribute using jQuery? It's for enabling tooltips using the tipsy jQuery plugin.
The jQuery attr() method is used to get attribute values.
To get the name, you'd use $(selector). attr('name') which would return (in your example) 'xxxxx' .
jQuery [attribute|=value] Selector The [attribute|=value] selector selects each element with a specified attribute, with a value equal to a specified string (like "en") or starting with that string followed by a hyphen (like "en-us").
The jQuery #id selector uses the id attribute of an HTML tag to find the specific element. An id should be unique within a page, so you should use the #id selector when you want to find a single, unique element.
$('[title]')
This will do the job.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With