xxxxxxxxxx
var style = document.createElement('style');
style.innerHTML = `
#target {
color: blueviolet;
}
`;
document.head.appendChild(style);
xxxxxxxxxx
const title = document.querySelector('h1')
//title.setAttribute('style', 'margin: 50px');
console.log(title.style); // Show all style propertyes
console.log(title.style.color); // Log a color in console
title.style.margin = '50px'; // Set a margin of title
title.style.color='crimson'; // Set a color of title
title.style.fontSize = '60px'; // Set font size of title
xxxxxxxxxx
element.style.backgroundColor = "red"; // set the background color of an element to red