Skip to main content
Home / Code Snippets / jQuery Code Snippets / Clear a File Input

Clear a File Input

You can just clone it and replace it with itself, with all events still attached.

var input = $("#control");

function something_happens() {
    input.replaceWith(input.val('').clone(true));
};