<html>
<body>
<script language="javascript">
document.getElementById('myfileId').onchange = function(e) { alert('change'); }
</script>
<form action="" >
<input type="file" id="myfileId" name="myfile">
</form>
</body>
</html>
How can I call the JavaScript function after a file selection.
Edit: 1
<html>
<body>
<form>
<input type="file" id="myfileId" name="myfile">
</form>
<script language="javascript">
window.onload = function()
{
alert("Test");
document.getElementById('myfileId').onblur = function(e) { alert('change'); }
}
</script>
</body>
</html>