jQuery :rootSelector

jQuery 选择器jQuery Selectors

Examples

Set the background color of the HTML document to yellow:

$(":root").css("background-color","yellow");

Try it Yourself »

Definition and Usage

The :root selector selects the root element of the document.

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


Syntax

$(":root")


jQuery 选择器jQuery Selectors

Other Extensions