본문 바로가기
공부방/자바스크립트

[자바스크립트] input type=file에서 선택된 값 초기화 하기

by 래채 2009. 11. 6.

<html>
<head>
<title></title>
<script>
function checkFile(file)
{
 alert(file.value);
 file.outerHTML = file.outerHTML;
}
</script>
</head>
<body>

 <form>
   <input type="text" name="txtName"><br>
   <input type="file" name="file"><br>
   <input type="button" value=삭제 onclick="checkFile(file);">
   <input type="button" value=확인 onclick="alert(this.form.upload.value);">

</form>
</body>
</html> 

- 되지만 outerHTML에 대해서 조사를 해야 할 것 같음