Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery :root selector

jQuery :root selector

jQuery selector jQuery selector

Example

Set the background color of the HTML document to yellow:

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

Try it »


Definition and Usage

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

In HTML, the root element is always the element.


Syntax

$(":root")


jQuery selector jQuery selector