I am trying to get the fontsize and fontfamily that my browser uses to display alerts, prompts etc. So I do:
alert(document.body.style.fontFamily); but it shows me a blank alert. Where am I going wrong?
Well, I agree with what Kolink says above, but there something you may also want to try:
<body id="body">
<script>
var theCSSprop = window.getComputedStyle(document.body,null).getPropertyValue("font-family");
console.log(theCSSprop); // output: serif
</script>
</body>
With the above code, once you open your FF and change the Proportional setting, you may see the out put is also changed. Have fun :)

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