jquery - Count number of selected images on file upload -
this question has answer here:
<input type="file" name="images[]" class="upload" accept="image/*" multiple="multiple"/>
now when choose i.e. 5 images, how can number jquery? when it's chosen, want write
5 images chosen.
use files.length
$('input[type="file"]').change(function () { console.log($(this)[0].files.length); });
Comments
Post a Comment