I am using angular, but I assume I can use any DOM manipulation for this ?
You can use getComputedStyle() and getPropertyValue().
Here's a running example:
var test = document.getElementById("test");
var result = document.getElementById("result");
result.value = getComputedStyle(test).getPropertyValue("font-family");
#test {
font-family: "Trebuchet MS",sans-serif;
}
<span id="test">What font family am I?</span>
<input id="result"></input>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With