【发布时间】:2016-03-26 14:29:57
【问题描述】:
我有这个 html:
<div id="top">
<div id="potato"></div>
</div>
<div id="bottom">
<div id="potato"></div>
</div>
我正在尝试使用 JQuery 来访问底部的土豆 div,但没有以下工作。
$('#top #potato').html('Russet');
$('#bottom #potato').html('Red');
$('#top > #potato').html('Russet');
$('#bottom > #potato').html('Red');
$('#potato').html('Idaho');
所有这些只是修改顶部的 div 而不是底部的。如何修改底部的div?
【问题讨论】:
-
@Matthew 这里有答案吗?你为什么不关注你的问题?
标签: jquery-selectors