1// Getting the element first
2var myElement = document.querySelector("#myElement");
3
4// examples for updating styles
5myElement.style.color = "blue";
6myElement.style.backgroundColor = "red";
1const title = document.querySelector('h1')
2
3//title.setAttribute('style', 'margin: 50px');
4
5console.log(title.style); // Show all style propertyes
6console.log(title.style.color); // Log a color in console
7
8title.style.margin = '50px'; // Set a margin of title
9title.style.color='crimson'; // Set a color of title
10title.style.fontSize = '60px'; // Set font size of title
1element.style.backgroundColor = "red"; // set the background color of an element to red