I have the following HTML node structure:
< 12条回答 庸人自扰 (楼主) 2020-11-28 01:52 $("#foo > div") selects all divs that are immediate descendants of #foo once you have the set of children you can either use the size function: $("#foo > div").size() or you can use $("#foo > div").length Both will return you the same result 0 讨论(0) 查看其它12个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复 热议问题
$("#foo > div")
selects all divs that are immediate descendants of #foo once you have the set of children you can either use the size function:
$("#foo > div").size()
or you can use
$("#foo > div").length
Both will return you the same result