 <p>That could be a div the styled during events and as other suggested make it contentEditable. With regards to textarea I have read similar question <a href="http://stackoverflow.com/questions/142527/highlight-text-inside-of-a-textarea">here</a>. Check it if it's what your looking for.</p>