![]() |
want to have alert() send current fontSize value of a specified element
Code:
alert(string(document.getElementById("body").style.fontSize));not sure what i am missing. |
1.to use that method you must have had that style inside the tag (or pre set up on-the-fly by a javascript function), not as an external CSS code.
<div id="body" style="font-size:20px">text</div> 2. If you have an embedded or external code, the syntax is otherwise for IE document.getElementById("body").currentStyle.fontSize for Mozilla document.defaultView.getComputedStyle(document.getElementById("body"),'').getPropertyValue("font-size") |
ah, okay. thanks.
|
| All times are GMT +1. The time now is 12:16 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.