var element = document.getElementById("elemId");
element.setAttribute("attributeName", "value");
//Fetch id from html
var a = document.getElementById("id");
//variable.setAttribute("Attributes","Properties:Values")
a.setAttribute("style", "visibility:hidden;");
Element.setAttribute(name, value);
const link = document.querySelector('a');
console.log(link.getAttribute('href'));
link.setAttribute('href', 'https://www.yahoo.com');
link.innerText='Yahoo';