Linking a Checkbox to a Button for accepting T&C

hi there i need some help with the coding and the linking of a checkbox for my site, i have some code done but every time i save and preview the site it doesn’t work and something is incorrect within the code.
will appreciate any help i didn’t code it myself as i do not know how to i got a friend to do it as she codes.

something like this…

$w.onReady( function () {

$w(‘#button1’).onClick((event) => {

if ($w(‘#checkbox1’).checked){

console.log("checkbox has been ticked"); 

//do some more stuff

}

})
})

i honestly haven’t a clue what that means and do not know how to incorporate it into my checkbox code

I honestly haven’t got a clue what your check box code is…

ill put it up here now

@cmackle998

something like this…
$w.onReady( function () {

$w(’ #c heckbox2’).onChange((event) => {

if ($w(’ #checkbox 2’).checked){

console.log(“checkbox has been ticked”);

//do some more stuff

$w(’ # button5’).enable();

}else {
$w(’ # button5’).disable();
}

})
})