D
Dan
Hi,
I want to get the height of an element and dividing by 2, but i don't know
how.
See the code:
<DIV ID="myDiv" STYLE="position:absolute; height:200">
....</div>
<script>
myObj = document.getElementById("myDiv").style;
dw = myObj.height / 2;
alert(dw)
</script>
Without dividing, i get '200px'.
With dividing, it produces "NaN".
I also tried dw=parseFloat( myObj.height / 2).
Thanks for help.
Dan.
I want to get the height of an element and dividing by 2, but i don't know
how.
See the code:
<DIV ID="myDiv" STYLE="position:absolute; height:200">
....</div>
<script>
myObj = document.getElementById("myDiv").style;
dw = myObj.height / 2;
alert(dw)
</script>
Without dividing, i get '200px'.
With dividing, it produces "NaN".
I also tried dw=parseFloat( myObj.height / 2).
Thanks for help.
Dan.