jQuery:Selector :root

:root

Overview

Select the root element of the document.

In HTML, the document’s root element, like the element selected by $ ( “: root”), is always the <html> element.

Demo

Set the <html> background color to yellow.

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

Leave a Reply

Your email address will not be published. Required fields are marked *