Latest web development tutorials

jQuery: root selector

jQuery selector jQuery selector

Examples

Setting HTML document background color is yellow:

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

try it"

Definition and Usage

: Root selector to select the root element of the document.

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


Syntax

$(":root")


jQuery selector jQuery selector