I'm trying to select items which match ".class#id"
, something that seems so natural as per Jquery multiple selectors, select items which match both criteria ,
but it only seems to work in firefox. Does IE just not support this?!
Specifically, I have
<div id="A" class="x">
<div id="A" class="y">
</div>
</div>
And I want to select $( ".y#A" )
Thanks, Nick
You should not have multiple elements with the same identifier. Internet Explorer probably recognizes this. (Or does not recognize this, but it coincidentally has a bug that behaves as if it did, and Microsoft decided to call it a feature.)
Simply give the elements that currently have the same ids, different ids and a common class name. Then you can use$('.class.class2')
and it will work in IE.
IE will complain that you have 2 elements with the same ID and cause some unusual behaviour.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With