Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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})          
  })
})
Comment

PREVIOUS NEXT
Code Example
Javascript :: JavaScript - HTML DOM Methods 
Javascript :: how to create a variable in javascript 
Javascript :: react native charts 
Javascript :: how to stop requestanimationframe in javascript 
Javascript :: js use await in synchronous method 
Javascript :: padstart in javascript 
Javascript :: for loop in javacript 
Javascript :: fastify 
Javascript :: object constructor js 
Javascript :: Importing From Export Default Module 
Javascript :: vuejs jwt authentication example 
Javascript :: http error 406 
Javascript :: js arrays in arrays 
Javascript :: react-dropzone-uploader 
Javascript :: socket io websocket connection 
Javascript :: + operator javascript 
Javascript :: window.innerwidth 
Javascript :: adding cors in angular 
Javascript :: discord bot not responding to commands 
Javascript :: find last item in an array JS 
Javascript :: A closure Function 
Javascript :: object model javascript 
Javascript :: passport js npm 
Javascript :: ?. in javascript 
Javascript :: express framework 
Javascript :: == vs === javascript 
Javascript :: line graph view click event 
Javascript :: dockument anywhere click fucntion in js 
Javascript :: leaflet-src.js?e11e:4066 Uncaught (in promise) Error: Map container not found 
Javascript :: how to print array of 52/ print it 5 times with different value in javascript 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =