JSFiddle - React, Tailwind, and code Playground

by borayeris

HTML

<input type="file" id="myFile" />

JavaScript

//binds to onchange event of your input field
$('#myFile').on('change', function() {

  //this.files[0].size gets the size of your file.
  alert(this.files[0].size);

});