When dealing with files in JavaScript, you may want to check whether or not a file is an image. This tutorial will show how to JavaScript check if file is image with pure JavaScript function and JQuery.

JavaScript

  • Check if file is image regardless of its type
  • Or If you want to target specific image types

JQuery

  • Using JQuery to check if the file is an image

References