Course Content

  • 3.5 attr_1
  • 3.5 attr_2

Course Content


The attr() method sets or returns the specified items' attributes and values. This function returns the value of the FIRST matched element when used to return the attribute value. This method sets one or more attribute/value pairs for the collection of matched elements when used to set attribute values.

The attr() method can be used to set the value of an attribute in a jQuery object. This allows you to change the appearance of your DOM elements without having to use JavaScript.

The attr() method can be used to access the attributes of an object. This can be useful when you want to make sure that you are only changing the attributes that you want to change. You can use this method in conjunction with other methods such as css() and html().

The attr() method is one of the most useful functions in jQuery. It can be used for many different purposes, including setting and retrieving attributes, adding event handlers, and more.

Recommended Courses

Share With Friend

Have a friend to whom you would want to share this course?

Download LearnVern App

App Preview Image
App QR Code Image
Code Scan or Download the app
Google Play Store
Apple App Store
598K+ Downloads
App Download Section Circle 1
4.57 Avg. Ratings
App Download Section Circle 2
15K+ Reviews
App Download Section Circle 3
  • Learn anywhere on the go
  • Get regular updates about your enrolled or new courses
  • Share content with your friends
  • Evaluate your progress through practice tests
  • No internet connection needed
  • Enroll for the webinar and join at the time of the webinar from anywhere