Petya petrov
Petya petrov

Reputation: 2223

colorize text in textarea with jQuery

i need to colorize part of the text in textarea. Let's say first line in red, second in blue. How to do this? (jQuery)

Upvotes: 9

Views: 4961

Answers (2)

ace
ace

Reputation: 6835

I'm not sure if it possible with textarea. Instead use div contentEditable.

See similar questions

Rendering HTML inside textarea

How to set background color for some inner text of HTML textarea element?

Upvotes: 8

Don Albrecht
Don Albrecht

Reputation: 1302

You can't easily style the contents of a text area, you can however use a simplified rich text editor to accomplish this.

something like RTE: http://batiste.dosimple.ch/blog/posts/2007-09-11-1/rich-text-editor-jquery.html or CLEditor: http://premiumsoftware.net/cleditor/ would be a good starting point for this.

Upvotes: 0

Related Questions