Tutorials References Exercises Bootcamps Videos Menu
Sign Up Create Website Get Certified Upgrade

jQuery :root Selector

❮ jQuery Selectors


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.



❮ jQuery Selectors