A Pen by Chelly

Thumbnail
This awesome code was written by chelly182, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright chelly182 ©
  • HTML
  • CSS
  • JavaScript
    <div>
  <input type="checkbox" value="a"/>
  <input type="checkbox" value="b"/>
  <input type="checkbox" value="c"/>
  <input type="checkbox" value="d"/>
</div>

/*Downloaded from https://www.codeseek.co/chelly182/a-pen-by-chelly-YQzVPy */
    


/*Downloaded from https://www.codeseek.co/chelly182/a-pen-by-chelly-YQzVPy */
    function doTheThing() {
   var activities = [];

  $('input:checked').each(function(){
    activities.push($(this).val());
  });

  var allActivities = activities.toString();
  console.log(allActivities);
}

$('body').on('click', doTheThing);

Comments