Matt_Helvey
07-07-2004, 07:26 PM
<html>
<head>
<title>test</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<script>
function replace(){
document.form.txt.replace(/<script>/, "<font color='red'><script></font>");
}
</script>
<body>
<form name="form">
<textarea name="txt" cols="20" rows="20" onKeyUp="javascript:replace();">test <script></textarea>
</form>
</body>
</html>
------------------------------------------
You problably understand what I want to get out of this. :confused:
I want that when you eg. write "<script>" in the textarea it turns red (only the word script)
I'm not totally of the road with this code right? Please help... :o
<head>
<title>test</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<script>
function replace(){
document.form.txt.replace(/<script>/, "<font color='red'><script></font>");
}
</script>
<body>
<form name="form">
<textarea name="txt" cols="20" rows="20" onKeyUp="javascript:replace();">test <script></textarea>
</form>
</body>
</html>
------------------------------------------
You problably understand what I want to get out of this. :confused:
I want that when you eg. write "<script>" in the textarea it turns red (only the word script)
I'm not totally of the road with this code right? Please help... :o