How can i change the color of the text that accompanies a checkbox.
[CODE]
<html>
<head>
<script type=”text/javascript” src=”testFunctions.js”></script>
<script type=”text/javascript”>
function test(){
document.getElementById( ‘append’ ).innerHTML = “”;
var divTag = document.createElement(“div”);
divTag.className =”checkBox”;
var cb = document.createElement( “input” );
cb.type = “checkbox”;
cb.id = “checkBox”;
cb.name = “checkBox”;
cb.checked = true;
cb.value = “checkBox”;
document.getElementById(“append”).appendChild(divTag);
divTag.appendChild(cb);
var textNode = document.createTextNode(“This is a check box”);
divTag.appendChild(textNode);
}
</script>
</head>
<body>
<p>click the button below</p>
<div id=”append” name=”append”></div>
<input type=”button” value=”createCheckBoxes” onclick=”test()” />
</body>
</html>
I have tried
[CODE]textNode.style.color = “blue”;
or
[CODE]cb.value.style.color = “blue”
But neither work……