slt..
I have a problem with js to clacul size of my body -- editor--
expl :
fonction getsize()
{
what .....
}
<form>
<textarea>i love js </textarea>
<botton onclick=getsize();>
</form>
tanks
Printable View
slt..
I have a problem with js to clacul size of my body -- editor--
expl :
fonction getsize()
{
what .....
}
<form>
<textarea>i love js </textarea>
<botton onclick=getsize();>
</form>
tanks
You need to be able to identify the element--try giving the element an id, such as "myTextArea".
Code:function getSize(id){
var el = document.getElementById(id);
var width = el.offsetWidth;
var height = el.offsetHeight;
alert( "Width: " + width +"px Height: " + height + "px");
}