Answers for "document style javascript"

2

js style

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
Posted by: Guest on July-19-2020
0

document style

document.getElementById("myH1").style.color = "red";
Posted by: Guest on November-10-2019
1

style through javascript

element.style.backgroundColor = "red";   // set the background color of an element to red
Posted by: Guest on July-10-2020

Code answers related to "document style javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language