title: Check multiple extension in javascript?
body: <p>Hello everyone how can I check my multiple file extions in input button with javascript like file must be mp3,mp4</p>
  
  <pre><code>&lt;p&gt;&lt;input type="file" id="file" name="file" size="23"/&gt;&lt;/p&gt;&lt;br /&gt;
          &lt;p&gt;&lt;input type="submit" value="Upload file" /&gt;&lt;/p&gt; 
  </code></pre>
  
  <p>Javascript:</p>
  
  <pre><code>$(function () {
      $('form').submit(function () {
          var selectedFile = $('#file').val();
          var matches = selectedFile.match(/\.(xlsx?)$/i);
          if (matches == null) {
              alert('please select an Excel file');
              return false;
          }
          return true;
      });
  });
  </code></pre>