How to add a class in Javascript/jQuery if an element has content in it?

后端 未结 4 1727
北荒
北荒 2021-01-25 08:56

I am working on a website in which I want to check whether element has any content in it.

Below is my html code. I have mentioned condition#1 where

4条回答
  •  日久生厌
    2021-01-25 09:09

    I think you can edit a bit in your code .not(":empty") to .html()

    
    

提交回复
热议问题