JSFiddle - React, Tailwind, and code Playground

by baximilian

HTML

<input id="theID" type="file" multiple="true"/>

<button id="test" >test</button>

JavaScript

var filesCounter = 0;

$("#theId").on('change', function()
{
    filesCounter = filesCounter + document.getElementById("theID").files.length;
});

$("#test").on('click', function()
              {
                  alert(filesCounter);
              });