1 //获取id=div1下的子元素的个数
2 $('#id').children().length;
3 //获取id=div1下的p元素个数
4 $('#id').children('p').length;

相关文章:

  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
  • 2022-12-23
  • 2022-12-23
  • 2021-09-08
猜你喜欢
  • 2022-12-23
  • 2021-11-29
  • 2021-11-20
  • 2021-11-29
  • 2021-10-18
相关资源
相似解决方案