You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
662 B

7 years ago
  1. <div data-container="file-input">
  2. <div class="form-inline" style="margin-bottom:10px;">
  3. <input type="file" name="userfile[]" class="form-control">
  4. </div>
  5. </div>
  6. <button type="button" class="btn btn-default" data-toggle="btn-add-file-input">파일 추가</button>
  7. <script>
  8. $(function(){
  9. $('[data-toggle="btn-add-file-input"]').on('click', function(){
  10. var div = $("<div>").addClass('form-inline').css('margin-bottom','10px');
  11. var input = $("<input>").attr('type','file').attr('name','userfile[]').addClass('form-control');
  12. div.append(input);
  13. $('[data-container="file-input"]').append(div);
  14. });
  15. });
  16. </script>