how to change the value of an attribute in javascript code example
Example 1: html change attribute
element.setAttribute(name, value);
var d = document.getElementById("d1");
d.setAttribute("align", "center");
Example 2: set attribute javascript
Element.setAttribute(name, value);