English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

jQuery :root Selector

jQuery Selectors

:root selector selects the root element of the document (always <html>).

Syntax:

$(':root')

Example

Select the root element:

$(document).ready(function(){
  $(':root').css('background', 'lightgreen');
});
Test and See‹/›

jQuery Selectors