Content Filter Selectors


SelectorExampleDescription
:contains()$('p:contains("Hello")')Selects all <p> elements that contains the text “Hello”.
:empty$("td:empty")Selects all <td> elements that are empty i.e that have no children including text.
:has()$("p:has(img)")Selects all <p> elements which contain at least one <img> element.
:parent$(":parent")Select all elements that have at least one child node either an element or text.

Leave a Reply

Your email address will not be published. Required fields are marked *