javascript - What portion of input field is occupied by the text? -
i trying make auto (height) increasing text field. need know when increase height of input field. need know if text has filled input field or not. there way ?
if can useful, quick solution textarea
next one:
javascript:
function resizetext(){ var cont = document.getelementbyid("mytext"); while (cont.scrollheight == cont.clientheight) cont.rows--; while (cont.scrollheight > cont.clientheight) cont.rows++; }
html:
<textarea id="mytext" rows="1" cols="30" onkeypress="resizetext()"> write here text. </textarea>
Comments
Post a Comment