enochsfootwear
Programmer
Hello,
I have a page with a Text area and some links above it that the user clicks to add to the text area, “AND”,”OR”,”NOT”, etc. I’m tying to change the color of the
Text that is added. I ‘ve tried the code below which changes the color of the text that is added but any text that is typed in after that is red, it’s like the </font> tag is not being closed. Here’s there something that I’m missing?
Thanks
I have a page with a Text area and some links above it that the user clicks to add to the text area, “AND”,”OR”,”NOT”, etc. I’m tying to change the color of the
Text that is added. I ‘ve tried the code below which changes the color of the text that is added but any text that is typed in after that is red, it’s like the </font> tag is not being closed. Here’s there something that I’m missing?
Thanks
Code:
<script type=”text/javascript>
Function addKeywork(){
var newText= document.createTextNode("hello world");
var newFont = document.createElement("font");
newFont.style.color = "red";
newFont.appendChild(newText);
document.getElementById('t1').appendChild(newFont);
}
</script>