jquery addattr code example
Example 1: jquery add attribute
$('#someid').attr('name', 'value');
Example 2: jquery attr multiple attributes
.attr({
target:"nw",
title:"Opens in a new window",
"data-value":"internal link" // attributes which contain dash(-) should be covered in quotes.
});
Example 3: get attribute value jquery
var some_var = $( some_jquery_selector ).attr( 'some_attribute_name' );