You get a bonus - 1 coin for daily activity. Now you have 1 coin

How to make an accompanying label clickable to toggle a checkbox to the opposite state?

Practice




How to make an accompanying label clickable so that it toggles the checkbox to the opposite state?

jqvery
$(".domain").click(function(){
if($('input',this).prop('checked')){
$('input',this).prop('checked', false);
}
else{
$('input',this).prop('checked', true);
}

});



css
.domain {
cursor:pointer;
}


HTML
vvvv

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Running server side scripts using PHP as an example (LAMP)"

Terms: Running server side scripts using PHP as an example (LAMP)