js code for the functionality of the checkboxes added