detecting font size using DOM -
01-11-2004
, 12:01 PM
hi all,
I'm writing a script which replaces a basic HTML element with a more complex DHTML one, and I want the script to try and emulate the look of the original as much as possible.
The problem is that the font-size, et al, of an unstyled element does not seem to be written into the DOM.
For example, I'd hope to get the original font-size of an element of id 'test1' like this:
a=document.getElementById('test1');
alert(a.style.fontSize);
Unfortunately, that only works if you initialise the font-size using JavaScript or CSS.
Any ideas on what to do here?
Kae |