I'm trying to create a textarea that will highlight some keywords as the user types in there. I understant textarea can only support plain text and that I have to use a 'rich text' editor in order to achieve this. I would like something really simple though and not the bloated 'rich editors' out there. Any ideas?
Thanks!
Here is a snippet that gives you the basics of what are looking for:
The basic concept is that the
<textarea>
(on top) is transparent and the<div>
underneath contains the "rich / hightlighted" version. There is room for improvement when it comes to wrapping text but you get the idea. Happy Highlighting!Credit: The preg_quote function is from Kevin van Zonneveld http://kevin.vanzonneveld.net/techblog/article/javascript_equivalent_for_phps_preg_quote/
Take a look at this one : http://codemirror.net/