views:

44

answers:

2

All,

In a html textarea is it possible to hightlight c and cpp syntax.If do please indicated an example code for it.

int main()

Int should be highlighted in this case since it is a keyword.

+1  A: 

you would need a scripting language (like PHP or JavaScript) to parse the text in the textarea and surround the keywords with a tag such as word . Then in your css you can add a style for class keyword

Aly
+2  A: 

http://www.cdolivet.com/index.php?page=editArea&sess=ba6469857a2ab4dacc7dc4a7b65545f5 and http://codepress.sourceforge.net/ are two very good options. I'm a fan of the first, but it's more work to set up.

pavpanchekha