jQuery contents Method


Get children of each element including text and comment nodes.


Syntax : jQuery contents() Method

$(selector).contents();

Note : It does not requires any argument.

jQuery contents Method Example

jQuery contents() Method Example with Syntax

<script type="text/javascript">
         $(document).ready(function(){         
             $( "div" ).contents().css( "background","yellow" );      
          });
</script>

Try it »


User Ans/Comments

📖 Read More


Advertisements