我是jQuery的新手,熟悉PHP & CSS。我嵌套,动态生成的div,我希望发送(id)到服务器端脚本来更新数字。我想检查.content类中的所有内容。只有带ID的div应该被发送处理;但是我无法做一个递归儿童()检查......这是最好的(非递归),我可以这样做:递归的.children()来搜索id属性
$(".content").children().each(function() {
if ($(this).attr('id').length == 0) {
$(this).children().each(function() {
if ($(this).attr('id').length == 0) {
$(this).children().each(function() {
if ($(this).attr('id').length == 0) {
$(this).children().each(function() {
alert($(this).attr('id'));
});
}
});
}
});
}
});
,它只是警告()的标识的一切在的他们应该在哪里。必须有更好的方法来做到这一点...提前感谢您的任何建议。 -Justin
通过警报(IDS)证实jQuery对象;.感谢您的及时回复。 – Justin 2010-12-09 11:49:49