JSFiddle - React, Tailwind, and code Playground
HTML
<dl> <dt><label for="fileupload">{L_FILENAME}:</label></dt>
<dd>
<input type="file" name="fileupload" id="fileupload" maxlength="{FILESIZE}" value="" />
</dd>
</dl>
JavaScript
$(document).ready(function () {
$("#fileupload").change(function (e) {
var val = $(this).val();
if (val.match(/(?:gif|jpg|JPG|JPEG|png|PNG|bmp)$/)) {
alert("You are trying to upload an image. Please use the image uploader!");
}
});
});