<ul>
  <li>John</li>
  <li>Karl</li>
  <li>Brandon</li>
</ul>

获取第一个元素:  $("ul li:first-child")

<div > 

  <ul>
    <li>John</li>
    <li>Karl</li>
    <li>Brandon</li>
  </ul>

</div>

获取第一个元素:  $("#getfirst").find("ul li:first-child")

或$("#getfirst").find("ul li").get(0)

或$("#getfirst").find("ul li").first()

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-10
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-29
  • 2021-05-29
  • 2021-12-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案