Reputation: 64793
Using jquery, I want to select input[type="text"]
elements which has a title attribute(not a specific content, just the existance of the title).
How can I achieve that ?
Upvotes: 3
Views: 1034
Reputation: 37516
You can specify multiple attributes, as in the following selector:
$('input[type="text"][title]')
Working example here: http://jsfiddle.net/VW64y/
Upvotes: 3
Reputation: 6955
$('input[type="text"][title]')
Adding the attribute name in brackets without any ='s will search for all elements which have that attribute
Upvotes: 3
Reputation: 32598
An attribute selector without the equals clause will just test for existence:
$("input[type='text'][title]");
Upvotes: 3