Opened 13 years ago
Closed 13 years ago
#5043 closed bug (invalid)
hiding table rows based on attributes hides ALL table rows instead
Reported by: | machba | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.3.2 |
Component: | selector | Version: | 1.3.2 |
Keywords: | table row attributes hide show | Cc: | |
Blocked by: | Blocking: |
Description
I have a table to which I've assigned attributes to each row like so:
<table>
<tr myId='1'><td>Some Content Here</td></tr> <tr myId='2'><td>Some Content Here</td></tr> <tr myId='3'><td>Some Content Here</td></tr>
</table>
I also have a button which the user can toggle hide/show all the rows using the following javascript code:
if(hide == true) {
$("tr[myId!=' ']").hide();
} else {
$("tr[myId!=' ']").show();
};
When this code is run, instead of only hiding the rows that have a myId attribute, it hides ALL the table rows on the page, even for other tables.
This had been working correctly in version 1.2.6.
Change History (1)
comment:1 Changed 13 years ago by
Component: | unfilled → selector |
---|---|
Resolution: | → invalid |
Status: | new → closed |
http://docs.jquery.com/Selectors/attributeNotEqual#attributevalue
"Matches elements that either don't have the specified attribute or do have the specified attribute but not with a certain value."
Sounds like this is a bug with 1.2.6 that was fixed in 1.3; I'd change your selector to limit it to the table with rows that all have a myId attribute.