programming/jsp

[jsp] 업로드 버튼 file 숨기기

labj 2016. 12. 4. 16:18


http://www.joshi.co.kr/board_nCHS89/291098



<script type="text/javascript">
 
$(function () {
 
$('#btn-upload').click(function (e) {
 
e.preventDefault();
 
$('#file').click();
 
});
 
});
 
     
 
            function changeValue(obj){
 
                alert(obj.value);
 
            }
 
</script>
 
 
 
 
<style type="text/css">
 
#file { display:none; }
 
</style>
 
 
 
 
<div>
 
<input type="file" id="file" name="file" onchange="changeValue(this)"/>
 
<button type="button" id="btn-upload">Image</button>
 
</div>