I am trying to have my .js file have a function that will change the color of the text within the div tag named "ID=test". I have the function (below), but I think I am missing something. I have three buttons in my HTML (red, blue, and black) that should change the text within the div to their respective color, but it isnt working currently.
function ChangeColor(changecolor)
{
document.getElementById('test')
x.type.color = changecolor
}
and my html is this....
<div id="test">
<h2>Test</h2><br /><br / >
<h2>change this text</h2>
</div>
<button type="button" onclick="loadXMLDoc('test1.txt')">Message 1</button>
<button type="button" onclick="loadXMLDoc('test2.txt')">Message 2</button>
<button type="button" onclick="loadXMLDoc('test3.txt')">Original</button>
<p>
<button type="button" onclick="return ChangeColor()">Red</button>
<button type="button" onclick="return ChangeColor()">Blue</button>
<button type="button" onclick="return ChangeColor()">Black</button>
</p>
<form id="form1" name="form1" method="post" action="">
</form>
<p> </p>
</body>
</html>
any help appreciated! it should just be some small line of code that I missed or something I think! thanks!