title: How to clear files from <input type='file' /> using jQuery or JavaScript
body: <p>There are several <code>&lt;input type='file' /&gt;</code> fields in my file and there are no any html <code>form</code>s. I want to clear attached files from particular <code>&lt;input type='file' /&gt;</code>. Not from the all fields. I have use <code>$('input').val("");</code> but it clears all the <code>&lt;input type='file' /&gt;</code> fields. So how I clear the attached files from particular <code>&lt;input type='file' /&gt;</code> field?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var control = $("#mcontrol");
  
  $("#clear").on("click", function() {
    $('input').val("");
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;input type="file" id="mcontrol" /&gt;&lt;br&gt;
  &lt;input type="file" id="mcontrol2" /&gt;
  &lt;button id="clear"&gt;Clear&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Here is the <a href="https://jsfiddle.net/isurufit/j2x7mcxk/" rel="nofollow noreferrer">fiddle</a> </p>