find first occurrence of class in div

前端 未结 8 2330
傲寒
傲寒 2020-12-14 05:45

I have the below html structure, i want to find the inner html of first div with class as \"popcontent\" using jQuery

相关标签:
8条回答
  • 2020-12-14 06:08

    you can use :first selector in this case

    $('.popContent:first').text();
    

    DEMO

    0 讨论(0)
  • 2020-12-14 06:14

    Use the Jquery :first selector like below :

    $(".popContent:first");
    
    0 讨论(0)
提交回复
热议问题