Get and Set HTML attributes in jquery

<input type="button" id="get_attribute" value="Get Attribute">
<input type="button" id="set_attribute" value="Set Attribute">
<input type="button" id="set_multiple_attribute" value="Set Multiple Attribute">
<a href="/" target="_blank">Coding 4 Developers </a>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<script>
$('#get_attribute').click(function(){
var link = $('a').attr('href');
alert(link);
}); ...  Read More

Share This: