jQuery Multiple ClassesSelector

jQuery 选择器jQuery Selectors

Examples

Select all elements with class "intro", "demo", or "end":

$(".intro,.demo,.end")

Try it Yourself »

Definition and Usage

.classThis selector can be used to select multiple classes.

Note:Separate each class with a comma.

Note:Do not use class attributes that start with a number! It may cause problems in some browsers.


Syntax

$(".class1,.class2,.class3,...")

Parameter Description
class Required. Specifies the class of the element(s) to select.


jQuery 选择器jQuery Selectors

Other Extensions