Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

getComputedStyle

const htmlBody = document.getElementByTagName("body")[0];
const htmlStyles = window.getComputedStyle(htmlBody);

console.log(htmlStyles["background-color"]); // rgb(243, 242, 239)
console.log(htmlStyles["font-size"]); // 16px
Source by www.javascripttutorial.net #
 
PREVIOUS NEXT
Tagged: #getComputedStyle
ADD COMMENT
Topic
Name
2+9 =