Просмотр поста

.
ДоХтор

erricss, был лишний элемент $(el).attr("class","2");

рабочий вариант (+/-)
<div id="files">
    <input name="file[]" type="file" accept="image/jpeg,image/jpg,image/png,image/gif" 
        class="1" onchange="make_input(this)">
</div>
 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script>
    function make_input(field) {
        var inp = field.outerHTML + '<br>';
        $(field).attr('class') == 1 ? $(inp).prependTo('#files') : '';
    }
</script>
UPD: Не много модернизировал =)