addEventListener
for input file select in IE 9 and 10 should trigger after the file selection but it triggers after the second time for file select, that means for the first time if no files are selected then for first select it wont trigger and after that for every file selection the listener event triggers (if different file is selected). My code snippet:
HTML
<input type="file" name="imagefile" id="upload">
JavaScript
var file = document.getElementById("upload");
file.addEventListener("change", handlefileselect, false);
function handlefileselect(event) {
alert("file selected");
}
The code runs fine in Firefox and Chrome but has a problem with IE.