Thursday, September 22, 2011

How to change the color of the font dynamically while text is typed in a textarea control ?

I have a textarea in an asp page. There will be some default text in it. Now when a user edits or types new text in the textarea, I want it to be highlighted with different color. How is this possible?How to change the color of the font dynamically while text is typed in a textarea control ?
%26lt;textarea name=';text'; onkeydown=';this.style.color = 'red';';%26gt;That is all :)%26lt;/textarea%26gt;



you can sustitue 'red' for a hex color code too:



#AAA = grey

#0E0 = blue

etc.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.