1element.setAttribute(<name>, <value>);
2// ex
3var aElement = document.querySelector("a");
4aElement.setAttribute("href", "https://isitchristmas.com/");
5// same as <a href="https://isitchristmas.com/"></a>
1element.setAttribute(name, value);
2
3
4var d = document.getElementById("d1");
5d.setAttribute("align", "center");