PDA

View Full Version : onClick Radio Box


lydiachin
09-09-2002, 07:49 AM
Hi!:o
I am facing on of the CSS behavior problem. I'm just new to the CSS and HTML, therefore, I am searching help over here.

What I want to do is, when on select the Radio box, the text of the Radio box will change to red color. Right now I am using Dreamweaver 4.0. Can this behavior set from Dreamweaver or I have to to put in some Script?

Thank you very much!:)

beetle
09-09-2002, 09:09 PM
function colorChange(node, chk) {
if (chk)
node.style.color = 'red';
else
node.style.color = 'black';
}

<span><input type="radio" onClick="colorChange(this.parentNode, this.checked)">Text to change color</span>