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

jQuery * Wildcard Selectors

jQuery Selectors

All selectors match each individual element on the page.

All selectors use the asterisk (**); Declaration.

All selectors can also select all elements within another element (see the following "Example" for details).

Syntax:

$("*)

Example

Select each element in the document (including head, body, etc.):

$(document).ready(function(){
  $("*").css("background-color", "lightgreen");
});
Test and See‹/›

Select all elements within the body to exclude elements such as head, script, title, etc.:

$(document).ready(function(){
  $("body *").css("background-color", "lightgreen");
});
Test and See‹/›

jQuery Selectors