Issue Check size from input

Issue Check size from input

hi all i m a beginner and i have a trouble, i'd like check multiple files size from input file and if it's too big do an alert.
I'm too bad, i don't know why that doesn't work :'(. If you could help a dumie ^^.
Check my input files with id "inputcontrol" and alert.
But nothing append!!!
Max Size 2000

Thks Guys :-) 


Below my html :
  1. <span class="btn btn-primary" id="browse">
  2.  Browse&hellip; <input type="file" style="display:none;" multiple id="inputcontrol" name="userfile[]">
  3. </span>
Below my Jquery:

  1. $('input[type="file"]').change(function(){
  2.     var imageSizeArr = 0;
  3.     var imageSize = document.getElementById('inputcontrol');
  4.                 var imageCount = imageSize.files.length;
  5.                 for (var i = 0; i < imageSize.files.length; i++)
  6.                 {
  7.                     var imageSize = imageSize.files[i].size;
  8.                         if (imageSize > 2000) {
  9.                             var imageSizeArr = 1;
  10.                         }
  11.                     if (imageSizeArr == 1)
  12.                     {
  13. alert("too big");
  14.                     }
  15.                     else if (imageSizeArr == 0)
  16.                     {
  17. alert("not too big");
  18.                     }
  19.                 }
  20.  });