[英]Select DIV in jQuery
我有两个ID为#container的div。
第一个是class .current-content
[div#container -- div.current-content]
第二个包含在类.next-content中 ,包含类current-content
[div#container -- div.next-content -- div#container -- div.current-content]
只能有一个带有.current-content类的#container和来自第二 .current-content的元素吗?
最终怎么办?
谢谢。 :)
每个id值在文档中只能使用一次。 如果为多个元素分配了相同的ID,则使用该ID的查询将仅选择DOM中的第一个匹配元素。 但是,不应依赖这种行为。 包含多个使用相同ID的元素的文档无效。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.