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

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -