Reputation: 10571
I am trying to hide the title of a link popping out in firefox but I am getting an error if I do the following:
$('a["title"]').on('mouseenter', function(e){
e.preventDefault();
});
Console
Uncaught Error: Syntax error, unrecognized expression: a["title"]
Upvotes: 2
Views: 107
Reputation: 240868
Omit the double quotes in the attribute selector. It should be a[title]
:
$('a[title]').on('mouseenter', function(e){
e.preventDefault();
});
The quotes usually represent an attribute's value. For instance, a[title="value"]
.
For further reference, the correct syntax for an attribute selector can be found here.
Upvotes: 3