1.

What is $.Deferred () method and how does it work?

Answer»

Yes, there is a selector called “: contains” which selects the elements that contains the specified text.

Here is the syntax:

$(":contains(text)")

Let's consider the following EXAMPLE which contains a SET of div elements contains text.

<div>John Resig</div> <div>George Martin</div> <div>Malcom John Sinclair</div> <div>J. OHN</div>

The following STATEMENT filters all the elements contains text "John" and underlines them.

<script> $("div:contains('John')").css("text-decoration", "underline"); </script>


Discussion

No Comment Found