I'm trying to use the following JS that I found around here and since I have multiple forms on a page I would like to customize the function to only work with specific form ID.
In my case <form id="car" ...
// required checkboxes
    var requiredCheckboxes = $(':checkbox[required]');
    requiredCheckboxes.change(function(){
        if(requiredCheckboxes.is(':checked')) {
            requiredCheckboxes.removeAttr('required');
        }
        else {
            requiredCheckboxes.attr('required', 'required');
        }
    });