HighDots Forums  

detecting font size using DOM

alt.html.dhtml alt.html.dhtml


Discuss detecting font size using DOM in the alt.html.dhtml forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Kae Verens
 
Posts: n/a

Default detecting font size using DOM - 01-11-2004 , 11:01 AM






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


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.