Is it possible to highlight text inside of a textarea using javascript? Either changing the background of just a portion of the text area or making a portion of the text selected?
Javascript – Highlight text inside of a textarea
javascripttextarea
Related Question
- Javascript – Trigger a button click with JavaScript on the Enter key in a text box
- Javascript – jQuery get specific option tag text
- Jquery – Set value of textarea in jQuery
- Javascript – Compare two dates with JavaScript
- Javascript – How to loop through or enumerate a JavaScript object
- JavaScript closure inside loops – simple practical example
- Javascript – Get selected value in dropdown list using JavaScript
Best Solution
Try this piece of code I wrote this morning, it will highlight a defined set of words:
This was written for another post (http://facebook.stackoverflow.com/questions/7497824/how-to-highlight-friends-name-in-facebook-status-update-box-textarea/7597420#7597420), but it seems to be what you're searching for.