我有这个 html 块
<div id="pane" class="MosadBoxRight scroll_pane" style="overflow: hidden; height: 590px; width: 250px; padding: 0px 41px 0px 0px;">
<div class="MosadBoxRightKoteretpopUp">text</div>
<div class="area" id="area1">
<a iframe="/4746929" style="cursor:pointer" class="alink" id="aLink">example1
</a></div>
<div class="area" id="area2">
<a iframe="4746929" style="cursor:pointer" class="alink" id="aLink">example1
</a></div>
<div class="area" id="area3">
<a iframe="/474692946" style="cursor:pointer" class="alink" id="aLink">example1
</a></div>
</div>
我也有这个javascript函数
function nextchapter() {
loc=loc+1;
var contextCmsPage = $("#pane .alink:nth-child(0)").attr("iframe");
}
和一个调用这个函数的按钮
<input type="button" id="btnc" onclick="nextchapter()" value="check" />
我正在尝试让alink
父亲 Div 中的第 n 个孩子pane
我变得不确定 $("#pane .alink:nth-child(0)").attr("iframe");
我也试过
$("#pane").find(".alink:nth-child(0)").attr("iframe");
结果相同
可能是什么问题?
谢谢
巴罗兹