Ticket #4131 (closed bug: duplicate)
Can't check for non-blank attributes
| Reported by: | chrisbarr | Owned by: | john |
|---|---|---|---|
| Priority: | major | Milestone: | 1.3.2 |
| Component: | selector | Version: | 1.3.1 |
| Keywords: | attribute notEqual attributeNotEqual blank | Cc: | |
| Blocking: | Blocked by: |
Description
I had an occasion where I needed to find all links of with a certain class which also did not have a blank title attribute. I thought to use the attributeNotEqual filter found here: http://docs.jquery.com/Selectors/attributeNotEqual
I ran something similar to this code:
$(".hello[title!=]").css("background-color","red");
And firebug returns: uncaught exception: Syntax error, unrecognized expression: title!=]
Demo here: http://jsbin.com/ibupo Editable demo: http://jsbin.com/ibupo/edit
Putting anything inside the quotes works as expected, but apparently you can't find elements without a blank attribute.
Change History
comment:2 Changed 4 years ago by dmethvin
Chris, does it look like this bug is the same as yours? If so it should be fixed in the next release.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

So.... the code sample I wrote above did not format correctly in here. Please check the example I linked to. http://jsbin.com/ibupo/edit