get attribute value jquery

JavaScript
$("button").click(function(){

  alert($("#w3s").attr("href"));

});
 var some_var = $( some_jquery_selector ).attr( 'some_attribute_name' );
Source

Also in JavaScript: