Here is some sample code of a ton of the exact same function in the project.
$('#psi').on('change', function() {
if($(this).is(":checked")) {
$('.psiOptions').removeClass('hidden-1');
} else {
$('.psiOptions').addClass('hidden-1');
}
});
I’m trying to upgrade this to not rely on JQuery. What is the most correct way to do this in Vanilla JS besides assigning onclick=”someFunction()” 20 different times for 20 different cases?