Using jQuery to see if a div has a child with a certain class

后端 未结 5 862
时光取名叫无心
时光取名叫无心 2020-12-12 15:58

I have a div #popup that is dynamically filled with several paragraphs with the class .filled-text. I\'m trying to get jQuery to tell me if #

5条回答
  •  情话喂你
    2020-12-12 16:50

    You can use the find function:

    if($('#popup').find('p.filled-text').length !== 0)
       // Do Stuff
    

提交回复
热议问题