JSFiddle - React, Tailwind, and code Playground

by andyjh07

HTML

<form id="toggleForm" action="">
<input type="checkbox" name="vehicle" value="Bike">I have a bike<br>
<input type="checkbox" name="vehicle" value="Car">I have a car 
</form>

JavaScript

$('input[type="checkbox"]').is(':checked', function(){
   var checkedValue = $(this).val();
   console.log("The checkbox value property is "+checkedValue);
});