KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I need to select elements without child node (including text since in <p> text is a child node). I used empty , but it also consider space as child node. Example: Markup: <span> </span> <span></span> Script: $("span:empty").html("this was empty!"); Unfortunately, only the second element were selected and changed since the first element has space and it was considered child node. How do I select elements without child node? I want to consider a space as nothing. Preferably, I want the code not to use loop to select them, there might be other ways.
Tags (comma-separated)
Save Edits
Cancel