<input type='file' accept='image/*' onchange='openFile(event)'><br>
<img id='output'>
<script>
var openFile = function(event) {
var input = event.target;
var reader = new FileReader();
reader.onload = function(){
var dataURL = reader.result;
var output = document.getElementById('output');
output.src = dataURL;
};
reader.readAsDataURL(input.files[0]);
};
</script>
실행 예시
'부스러기 > WEB' 카테고리의 다른 글
<Spring > SessionAttributes 실험 (0) | 2018.03.13 |
---|---|
<BootStrap>Modal 에서 autocomplete 안나올때 (0) | 2017.11.08 |
<BootStrap> colum full height css (0) | 2017.08.24 |
WAS (Wep Application Server) tomcat 디렉토리 구조 (0) | 2017.07.01 |