jQuery Multiple ElementsSelector

jQuery 选择器jQuery Selector

Examples

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

$("h2,div,span")

Try it Yourself »

Definition and Usage

elementThe selector can be used to select multiple elements.

Note:Separate each element with a comma.


Syntax

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

Parameter Description
element Required. Specifies the elements to select.


实例

Try it Yourself - Examples

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


jQuery 选择器jQuery Selector

Other Extensions