♦ jQuery get attr()
♣ Example4: jQuery get attr()
Returns the Attribute content of selected HTML element from selected attribute.Below is the representation of jQuery get attr() Syntax.
Basic Syntax
$(selector).attr(attribute_selector)
selector: the HTML element to be selected.
attr(): syntax for selecting attribute value from HTML element.
attribute_selector: the attribute selector for the HTML element.(eg, href, src, etc)
In this example, .attr(): syntax for selecting attribute value from HTML element.
attribute_selector: the attribute selector for the HTML element.(eg, href, src, etc)
Example
Input:
Output: