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.

demo

use files.length

$('input[type="file"]').change(function () {   console.log($(this)[0].files.length); }); 

Comments

Popular posts from this blog

html - jquery - p element wont show after I hid it -

python - BeautifulSoup: How to get the nearest tag -

php - Return Last Insert ID with PDO -