-4
我在使用jquery访问子项时遇到了一些问题。 我有一个HTML这样jquery在div中找到一个元素
<div id="wrapper">
<div>
<div>
<table id="customer">
</table>
</div>
</div>
</div>
我有这个jQuery这样
var parentDiv = $('#wrapper');
var table= parentDiv.html();
console.log(table);
输出
<div>
<div>
<table id="customer">
</table>
</div>
</div>
table = $(table); //jquery object
//i want the table customer of this object
我要的是让客户表。我怎样才能使用var表? .each()仅提取div以及.find()。
像这样
$(innerHtml).each(); //or whatever function i can use to get the table
使用'$( '#客户')'没有必要找 – guradio
耶,我可以这样做,但我想要的是让innerHtml的表。 – n4mi
哪个div内部的html? –