jQuery複数クラスセレクター

❮jQueryセレクター

クラス「intro」、「demo」、または「end」を持つすべての要素を選択します。

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

定義と使用法

.classセレクターを使用して、複数のクラスを選択することもできます。

注:各クラスはコンマで区切ります。

注:クラス属性を数字で開始しないでください。一部のブラウザで問題が発生する可能性があります。


構文

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

Parameter Description
class Required. Specifies the class of the elements to select

❮jQueryセレクター