JSFiddle - React, Tailwind, and code Playground
by Ford Perfect
HTML
<input type="file" onchange="if(parseInt($(this).get(0).files.length)>2) alert('You can only upload a maximum of 2 files'); else alert('You are within the limit');" multiple/>
by Ford Perfect
<input type="file" onchange="if(parseInt($(this).get(0).files.length)>2) alert('You can only upload a maximum of 2 files'); else alert('You are within the limit');" multiple/>