Attributes
An element's attributes can contain useful information for your application, so it's important to be able to get and set them.
$.fn.attr
The $.fn.attr method acts as both a getter and a setter. As a setter, $.fn.attr can accept either a key and a value, or an object containing one or more key/value pairs.
$.fn.attr as a setter:
|
1
2
3
4
5
6
7
|
|
$.fn.attr as a getter:
|
1
2
|
|