1

is it possible to have a <textarea> widget to support php syntax coloring with jQuery?

In short, I'd need to colorize code while the user is typing it into the textarea.

It would be great if line numbers were shown too, but it is not strictly necessary.

Any other framework would eventually be welcome.

Thanks.

2 Answers 2

4

There's a neat javascript library called CodeMirror that allows to do that.

There's the option to display line numbers, and works in real time, for a variety of languages, including PHP.

It is not related to and does not depend on jQuery.

Sign up to request clarification or add additional context in comments.

Comments

0

You can change the color of the textarea in the onchange with:

onchange="$(this).css('color','#00FF00')"

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.