Monday, July 17, 2017

What is Get Attributes?

Get Attributes - attr()

The jQuery attr() method is used to get attribute values.
The following example demonstrates how to get the value of the href attribute in a link:

Example

$("button").click(function(){
    alert($("#w3s").attr("href"));
});