1 //获取id=div1下的子元素的个数
2 $('#id').children().length; 3 //获取id=div1下的p元素个数 4 $('#id').children('p').length;
jQuery获取子元素个数的方法
猜你喜欢
转载自www.cnblogs.com/smile-fanyin/p/10892821.html
今日推荐
周排行