how to set a variable to attribute value of an element in javascript code example
Example: setAttribute()
element.setAttribute(name, value);
element.setAttribute("style", "background-color: red;");
element.setAttribute(name, value);
element.setAttribute("style", "background-color: red;");