Please note, this is a STATIC archive of website www.w3schools.com from 05 May 2020, cach3.com does not collect or store any user information, there is no "phishing" involved.
THE WORLD'S LARGEST WEB DEVELOPER SITE

jQuery :root Selector

❮ jQuery Selectors

Example

Set the background color for the HTML document to yellow:

$(":root").css("background-color", "yellow");
Try it Yourself »

Definition and Usage

The :root selector selects the document's root element.

In HTML, the root element is always the <html> element.


Syntax

$(":root")

❮ jQuery Selectors