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

jQuery element Element Selector

jQuery Selectors

Element selectors select all elements based on the element name.

Syntax:

$("element")

Instance

Select each <p> element:

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

Select all <p> elements with the class "demo":

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

Parameter Value

ParameterDescription
elementSpecify the element to search for. Reference the tagName of the DOM node.

jQuery Selectors