JSFiddle - React, Tailwind, and code Playground
HTML
<form action="">
<input type="checkbox" class="checkboxes" name="vehicle" value="Bike">I have a bike<br>
<input type="checkbox" name="vehicle" value="Car">I have a car
</form>
JavaScript
function multiply(this_object){
if(this_object.is(':checked'))
return 2 * 2;
else
return "blah";
}
$(document).ready(function(){
$('.checkboxes').click(function(){
var this_object = $(this);
alert(multiply(this_object));
});
});