felgall
11-24-2005, 09:56 PM
There is no such thing as a <color> tag. Colour like all display options are defined in the stylesheet. You can of course set up Javascript to apply the appropriate stylesheet class to different parts of the page.
The following is part of what you might use:
<style>
.red {color:#f00;}
.green {color:#0f0;}
.blue {color:#00f;}
</style>
<script type="text/javascript">
function changeColour(field,colour) {
document.getElementById(field).className = colour;
}
</script>
joonstar
11-24-2005, 10:15 PM
There is no such thing as a <color> tag. Colour like all display options are defined in the stylesheet. You can of course set up Javascript to apply the appropriate stylesheet class to different parts of the page.
The following is part of what you might use:
<style>
.red {color:#f00;}
.green {color:#0f0;}
.blue {color:#00f;}
</style>
<script type="text/javascript">
function changeColour(field,colour) {
document.getElementById(field).className = colour;
}
</script>No, no. whether <color=red> is a real tag or not is not matter because I will transfering "<color=red>" into "<font color=red>" or "<span class=red>" when it is saved into database.
The main matter of my question is automatically generating " <color=red> " into the textarea box while a user write his or her message into the textarea box by using selecting option box.