jquery set value attribute code example
Example 1: 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 2: jquery set data attribute value
//<div id="myElementID" data-myvalue="37"></div>
var a = $('#myElementID').data('myvalue'); //get myvalue
$('#myElementID').data('myvalue',38); //set myvalue
Example 3: jquery set att
$input.attr("attributeName", "attributeValue");