Javascript call not quite right

I have an onclick event for a radio button:
if ({luxnon}==‘L’) {
sc_ajax_javascript(‘checkmates’);
}

Here is “checkmakes” in the javascript programming section of the form app:
var LuxuryList = [‘BENTLEY’,‘VOLVO’,‘FERRARI’,‘BMW’];
var inputs = document.querySelectorAll(’[id^=‘id-opt-makes-’]’);
for (var i = 0; i < inputs.length; i++) {
if ( LuxuryList.indexOf(inputs[i].value) >= 0 ) { inputs[i].checked = true;
}
}

The goal is to go through all the “makes” checkboxes and where it finds the value of bentley, volvo, ferrari, bmw set those checkboxes to selected. Alas, it does call the script, but changes nothing. What is up?

GOT it. The javascript CHECKMATES needed double quotes around the queryselectorall so correct js is:
var LuxuryList = [‘BENTLEY’,‘VOLVO’,‘FERRARI’,‘BMW’]; //this can be anything you need
var inputs = document.querySelectorAll("[id^=‘id-opt-makes-’]"); //makes is the name of checkbox field
for (var i = 0; i < inputs.length; i++) {
if ( LuxuryList.indexOf(inputs[i].value) >= 0 ) { inputs[i].checked = true;
}
}

The var luxurylist can really be anything. This one is just a test. But this allows me to have a radio button programmatically check and uncheck. Hope it’s useful.