This is my code:
<div style="position:absolute;top:300px;width:50px;height:50px;background:red;color:black;word-wrap:break-word;">
<div contenteditable=true>
aaaaa
bbbbbbbbbbb
</div>
</div>
I want to fill all of the space in the div.
How many pixels is the
?
You can create a <div>
containing
and assign an id
. Set the font size and attributes. Then read the current width and height using:
var space=document.getElementById("space");
var height=(space.clientHeight+1)+"px";
var width=(space.clientWidth+1)+"px";