javascript set by name code example
Example: javascript update attribute
var element = document.getElementById("elemId");
element.setAttribute("attributeName", "value");
var element = document.getElementById("elemId");
element.setAttribute("attributeName", "value");