YouTip LogoYouTip

Jq Sel Class

jQuery .class Selector | Tutorial

Tutorial -- Learning is not just about technology, but also about dreams!

jQuery Tutorial

jQuery Tutorial jQuery Introduction jQuery Installation jQuery Syntax jQuery Selectors jQuery Events

jQuery Effects

jQuery Hide/Show jQuery Fading jQuery Sliding jQuery Animation jQuery Stop Animation jQuery Callback jQuery Chaining

jQuery HTML

jQuery Get jQuery Set jQuery Add Elements jQuery Remove Elements jQuery CSS Classes jQuery css() Method jQuery Dimensions

jQuery Traversing

jQuery Traversing jQuery Ancestors jQuery Descendants jQuery Siblings jQuery Filtering

jQuery Ajax

jQuery AJAX Introduction jQuery load() Method jQuery get()/post() Methods

jQuery Other

jQuery noConflict() Method jQuery JSONP

jQuery Examples

jQuery Examples

jQuery Reference

jQuery Selectors jQuery Event Methods jQuery Effect Methods jQuery HTML / CSS Methods jQuery Traversing Methods jQuery AJAX Methods jQuery Miscellaneous Methods jQuery Properties

jQuery Plugins

jQuery Validate jQuery Cookie jQuery Accordion jQuery Autocomplete jQuery Growl jQuery Password Validation jQuery Prettydate jQuery Tooltip jQuery Treeview

jQuery Examples

jQuery Event Methods

jQuery .class Selector

jQuery Selectors jQuery Selectors

Example

Select all elements with class "intro":

$(".intro")

Try it yourself Β»


Definition and Usage

The .class selector selects all elements with the specified class.

class refers to the class attribute of an HTML element.

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

Note: Do not use a number as the first character of a class name! This may cause issues in some browsers.


Syntax

$("._class_")
Parameter Description
class Required. Specifies the class of the elements to select.

Try it - Example

Select all p elements with class "intro"

How to select all p elements with class "intro".


jQuery Selectors jQuery Selectors

← Sel Multiple ClassesJq Sel Id β†’