Example 1 — Official Demo: Root nodeName
Display the tag name of the document root (jQuery API example).
$("#log").text($(":root")[0].nodeName); How It Works
- Select.
$(":root")returns a one-element collection. - Unwrap.
[0]is the raw DOM node. - Read.
nodeNameis"HTML"in HTML documents.

