$("li").children("a:eq(0)") ; children()查找子元素,eq() 查找第几个

$('.active').children("a:eq(0)").attr("id"); 获取class=active元素下的第一个a标签的id值

相关文章:

  • 2022-12-23
  • 2021-11-03
  • 2021-11-29
  • 2021-10-16
  • 2022-12-23
  • 2021-09-11
  • 2022-12-23
  • 2022-01-11
猜你喜欢
  • 2021-12-14
  • 2021-11-29
  • 2021-06-11
  • 2022-12-23
  • 2022-01-01
  • 2021-12-28
相关资源
相似解决方案