Answers for "length of textarea in javascript"

2

get height of text in textarea

ele.scrollHeight (Height of text inside scroll inlduing what u cant see)
ele.clientHeight (What u see)
Posted by: Guest on September-05-2021
0

hi;ight word in textarea javascript

$(function(){
  $("#search").click(function(){
    var area   = $('#test');
    var findWord = "rhoncus";
    var index = area.val().indexOf(findWord);
    area.focus().prop({'selectionStart': index, 'selectionEnd': index+findWord.length})          
  })
})
Posted by: Guest on February-15-2021

Code answers related to "length of textarea in javascript"

Browse Popular Code Answers by Language