jQuery .class Selector | Tutorial
Tutorial -- Learning is not just about technology, but also about dreams!
- Home
- HTML
- JavaScript
- CSS
- Vue
- React
- Python3
- Java
- C
- C++
- C#
- AI
- Go
- SQL
- Linux
- VS Code
- Bootstrap
- Git
- Local Bookmarks
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 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 .class Selector
Example
Select all elements with class "intro":
$(".intro")
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".
YouTip