What is the main difference between the contents() and children() functions?
contents()
children()
The children() function only includes text nodes of the selected elements.
They both return the content of selected nodes, but contents() also includes text and comment nodes.
They both return the content of selected nodes, but children() also includes text and comment nodes.
The contents() function only includes text nodes of the selected elements.