jQuery‎ > ‎

contains selector

Select all elements that contain the specified text.

Select div element containing the text "Home" and change its css color style to white:

<script type="text/javascript">
 
$(document).ready(function(){
    $("div:contains('Home')").css("color","#fff");
});
 
</script>


Comments