JSFiddle - React, Tailwind, and code Playground

by dying_sakura

HTML

<input type="button" class="sal" value="0">
<input type="button" class="sal" value="0">
<input type="button" class="sal" value="0">
<input type="button" class="sal" value="0">

JavaScript

var i = [];
$( document ).ready(function() {

            $('.sal').each(function(elem) {
            $(this).click(function(e) {

                 i.push($(this).val());
                console.log(i);
            }); 
          });
});