對我的生活中,我無法弄清楚如何使用文本訪問的第一個div「我想這一個」開始DIV1的ID如何使用jQuery訪問div元素2層下來
我嘗試:
$("#div1").first().first().html();
下面是一個例子
<div id="div1">
<div class="row">
\t <div class="another">I want this one</div>
<div class="another">Not this one</div>
</div>
</div>
好,首先你得正確選擇div1。然後,你應該使用正確的jQuery方法。如果你仔細閱讀文檔,清楚地。首先不是你想要的。 –
修復了選擇器..顯然我不會問是否知道:) –