Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
How to get objects by ID, Class, Tag, and Attribute in jQuery?
Here?s how you can get objects by ID Selector (#id), by Class Selector (.class), by Tag, and Attribute (.attr()).
Get Object by Class Selector
Example
The element class selector selects all the elements which match with the given class of the elements.
jQuery Selector This is first division of the DOM.
This is second division of the DOM.
Get Object by ID Selector
Example
The element ID selector selects a single element with the given id attribute:
jQuery Selector
Get Object by Tag
Example
For this, pass the name of the specific tag i.e. tag below:
One TwoClick any of the link above and you can see the changes.
Get Object by Attribute
Example
Using the .attr(), you can get any attribute of any tag. Here?s an example showing how to get an attribute value:
jQuery Example
Advertisements

