Is there any possibility to change the text-color of some parts in a textarea in HTML?
I like to output some highlighted PHP-Code on my website and give the possibil
So, you would display properly 'colored' code;when the user clicks on the div with the code, it changes to an editable textarea and if the user clicks on the icon besides the textarea, the code is copied to the clipboard.
There are many scripts out there that do just this, here's a nice list
9 Useful Javascript Syntax Highlighting Scripts
Most of these have the functionality you require, so you don't need to reinvent the wheel - unless you really want to :-)
No, it's impossible, but you can have some css to make a div to look like it's a <textarea>
and inside the div you can put several <span>
s with colors.
You can also use something like this