The focus() method is used to set focus to the FileUpload object.
<html>
<head>
<title>Using the focus method to set focus to FileUpload box</title>
</head>
<body>
<script language="JavaScript">
<!--
function checkFile(){
document.form1.uploadbox.focus();
document.form1.textbox.value = "Verify that filename is correct";
}
-->
</script>
<form name="form1">
Enter Filename:
<input type="file" name="uploadbox">
<input type="button" value="Okay" onClick="checkFile()">
<br><br>
Confirmation Message:
<input type="text" name="textbox" size=35>
</form>
</body>
</html>