:contains()
selectorThe jQuery :contains
selector is used to select the element that it's content contains the specified string.The string is case-sensitive.
:contains()
selector Syntax$(':contains(string)')
:contains()
selector ExamplesFollowing is a simple example which would find all div containing 'jQuery' and hightlight them:
<div>jQuery books</div> <div>jquery tutorial</div> <div>jQuery Examples</div> <div>j.Query</div> <script> $("div:contains('jQuery')").css('background','cyan'); </script>
In below example,We will search from a content list: