ExampleSelect elements with class "intro":
Try it yourself » |
The . selector selects elements with a specific class.
The class refers to the class attribute of a HTML element.
Unlike the id attribute, the class attribute is most often used on several elements.
This allows you to set a particular style for any HTML elements with the same class.
$(".class") |
Parameter | Description |
---|---|
class | Required. Specifies the class of the elements to select. The class selector uses the class attribute of the HTML element |
Note: Do not start a class name with a number. It may cause problems in some browsers.