I\'d like to set text in a textarea or text input using different colors (one or the other is fine, I don\'t need both). Think of something like simple syntax highlighting.
No, you can't do this in a textarea or text input. Any CSS text-related property will affect the whole text within the the textarea/input. You'll need an editable element or document to achieve syntax highlighting. Example (works in all recent browsers; the last major browser not to support contenteditable
was Firefox 2.0):
var foo = "bar";