PDA

View Full Version : textarea grammar



midhul
02-11-2008, 10:44 AM
hi,


I want a script which can automatically change color of the text in a textarea
for example if the user enters hello it should automatically change to green
like it happens on code editors.

can any body help!

jscheuer1
02-11-2008, 06:22 PM
A textarea is not a code editor. If you want about as many features as possible like that use:

http://www.dynamicdrive.com/dynamicindex16/richtexteditor/index.htm

or a script like it. If you just want to know how to change the color of a textarea using javascript:


<body>
<textarea id="test" cols="50" rows="5" wrap="virtual""></textarea>
<script type="text/javascript">
document.getElementById('test').style.color='green';
</script>
</body>