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

qt - QML MouseArea onWheel event not working properly when inside QML Scrollview -

java - is not an enclosing class / new Intent Cannot Resolve Constructor -

python - Error importing VideoFileClip from moviepy : AttributeError: 'PermissionError' object has no attribute 'message' -