Latest web development tutorials

multiple elements jQuery selectors

jQuery selector jQuery selector

Examples

Select all <h2>, <div> and <span> element:

$("h2,div,span")

try it"

Definition and Usage

element selector can be used to select more than one element.

Note: Use commas to separate each element.


grammar

$("element1,element2,element3,...")

参数 描述
element 必需。规定要选取的元素。


Examples

Try - Example

Select all the elements
* Use the selector to select all elements in the document.


jQuery selector jQuery selector