ユーザーがテキストの横にあるチェックボックスをオンにすると、テキストの色が変わります。
これは私が持っているコードです:
<p style="color: #FF0000; font-weight: bold;">
I have read and agree to the terms and conditions
<input type="checkbox" id="termsChkbx" />
</p>
これは私がこれまでに持っている機能です:
function hasTickedBox( checkBoxID) {
var chkbx = document.getElementById( checkBoxID );
if ( chkbx.checked ) {
//change the font color
} else {
//do nothing
}
}