T
Tuxedo
It is easy to get a monitor's width in pixels by 'screen.width' on IE and
other browsers, and 'document.width' can measure approximate browser widths
on non-IE browsers.
But is it also possible to get a value of a non-fixed width <div>, that may
for example be nested within another, also non-fixed width type of block,
such as a <div>, <table> or <p> etc.
<p>
<div id="myContent">
This doesn't get me close to any value on either Mozilla or IE. At least
not unless I set the div tag style="width:.. attribute beforehand, in which
case I won't need to find out the value in the first place.
</div>
</p>
<script>
var myDiv = document.getElementById("myContent");
var myWidth = myDiv.style.width;
</script>
Are there some other methods in Javascript to access the width properties
of these HTML objects before or after the page has been fully loaded?
other browsers, and 'document.width' can measure approximate browser widths
on non-IE browsers.
But is it also possible to get a value of a non-fixed width <div>, that may
for example be nested within another, also non-fixed width type of block,
such as a <div>, <table> or <p> etc.
<p>
<div id="myContent">
This doesn't get me close to any value on either Mozilla or IE. At least
not unless I set the div tag style="width:.. attribute beforehand, in which
case I won't need to find out the value in the first place.
</div>
</p>
<script>
var myDiv = document.getElementById("myContent");
var myWidth = myDiv.style.width;
</script>
Are there some other methods in Javascript to access the width properties
of these HTML objects before or after the page has been fully loaded?