> "George Hester" wrote
I have this in a html
<div id="fltUp" align="center">
<font size="3+" id="fntStop">Howdy</font>
</div>
Now in JavaScript I can read fltUp.innerText.length. But if
the size of the font changes fltUp.innerText.length does not.
How can I compensate the width of Howdy when the font
size changes? Thanks.
Not sure about the + sign in the sizefont tag. Also not sure what you want
to compensate. fltUp.innerText.length will give the number of characters (in
some environments) but width depends on much much more. For that you could
(in some environments) read
document.getElementById('fltUp').offsetWidth
which will give you the width of the element in pixels.
It may turn out the div is as wide as the window. Then read the width the
font tag itself. The font tag is deprecated by the way. Use a span.
And post in plain text format please.
Thanks,
Ivo