Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get element font size javascript

// get reference to element using its ID or querySelector
const myElement = document.getElementById("elementID");

// pass element reference and getPropertyValue of font-size
const size = window.getComputedStyle(myElement).getPropertyValue("font-size");
 
PREVIOUS NEXT
Tagged: #element #font #size #javascript
ADD COMMENT
Topic
Name
4+6 =