Entry
How can I set the background color of a checkbox?
How can I change the background color of a checkbox?
Mar 31st, 2000 10:56
Martin Honnen,
NN4+ and IE4+ allow to set the background color with css
<INPUT TYPE="checkbox" STYLE="background-color: lime;" ...>
IE4+ and NN6 also allow dynamic change with JavaScript, for instance in
the onclick handler:
<INPUT TYPE="checkbox" NAME="aCheckBox" VALUE="Kibo"
STYLE="background-color: lime;"
ONCLICK="if (this.style && !this.checked)
this.style.backgroundColor = 'lime';
else if (this.style && this.checked)
this.style.backgroundColor = 'red';"
>