开发者

Jquery multiple selector criteria with Internet Explorer

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜