Home  >  jQuery

Example of :contains() Selector in jQuery

April 29, 2013
:contains() Selector is used on any DOM element. As arguments it takes any text and then it searches for that text within the calling element. Syntax is
Find the example.

<!DOCTYPE html>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<p>We are at jQuery page.</p>
<p>We can learn a lot here.</div>
<p>jQuery is write less , do more</p>

$("p:contains('jQuery')").css("color", "blue");</script>


We are at jQuery page.

We can learn a lot here.

jQuery is write less , do more

©2022 concretepage.com | Privacy Policy | Contact Us