jQuery contents() Method
jQuery contents() Method
The contents() method is used to return all direct children, including text and comment nodes, of the selected element. A text node is an actual text displayed by an element. It is similar to the children() method but it returns comment nodes and text nodes with it.
Syntax:-
Its syntax is:- $(selector).contents()