JQuery 업로드 파일 추가

jQuery 업로드 파일 추가

1 예시[ | ]

<script src="//code.jquery.com/jquery-2.1.1.min.js"></script>
<script>
$(function(){
	$('#button-add-file').click(addFileForm);
	$(document).on('click', '.button-delete-file', function(event) {
		$(this).parent().remove();
	});
});
var count = 0;
function addFileForm() {
	var html = "<div id='item_"+count+"'>";
	html += "<input type='file' name='fileup[]' />";
	html += "<button class='button-delete-file'>삭제</button></div>";
	count++;
	$("#my-form").append(html);
}

</script>
<button id='button-add-file'>파일 추가</button>
<form id='my-form'></form>

2 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}