document.getElementById("myElement").style.cssText = "display: block; position: absolute";
//use template literals
document.getElementById("myElement").style.cssText = `
display: block;
position: absolute;
`;
document.getElementById("myElement").style.cssText = "display: block; position: absolute";
Object.assign(yourelement.style,{fontsize:"12px",left:"200px",top:"100px"});
const anchor = document.querySelector('a');
Object.assign(anchor.style, {
color: 'white',
letterSpacing: '2px'
});
document.getElementById("myElement").style.cssText = `
display: block;
position: absolute;
`;
//Remeber the quotation marks should be template literal ones
//If you created the style value as a variable,
//you can use template literal like display: ${myDisplay}