I want to select an html element with jquery using its attribute value.
I use $('td[i=0]')
and it works correctly. What if i want to use 2 attribute together.
For example, I want to select td element with attributes i="0" and j="2" .
I want to select an html element with jquery using its attribute value.
I use $('td[i=0]')
and it works correctly. What if i want to use 2 attribute together.
For example, I want to select td element with attributes i="0" and j="2" .
You can just append them, e.g.:
('td[i=0][j=2]')
This works for pretty much any selector, adding them together without a space makes it check for the attribute on the same element.
jQuery OR Selector:
$("td[i=0], td[i=2]")
jQuery AND Selector:
$("td[i=0][i=2]")