title: Js or jquery file.type.match for jpg and png only
body: <p>How can I limit the mimetype for only png and jpg using file.type.match</p>
  
  <p>below is my code</p>
  
  <pre><code>var fileInput = document.getElementById("myfileinput").files[0];
  
  if (fileInput.type.match('image/jpeg'))  
        //I not thinking to use if(xx || xx)
        //prefer using var mimeType = jpg,png  many tries but not work
  {
  alert("Right");
  }else{
  alert("wrong");
  }
  </code></pre>