WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

jQuery .class Selector

jQuery Selectors jQuery Selectors

Example

Select all elements with class "intro":

$(".intro")
Try it yourself »

Definition and usage

.class selector selects all elements with the specified class.

class refers to the class attribute of an HTML element.

class attribute is used to set specific styles for multiple HTML elements.

Note: Don't use class attributes that start with numbers! Problems may occur in some browsers.


Syntax

$ (". class ")

parameters description
class Required. Specifies the class of the element to be selected.


jQuery Selectors jQuery Selectors