The ‘change’ event listener will only trigger when the value of the input changes, so if the same id is selected, no change would be triggered, and the event will not show.
For instance, if you’re creating an AJAX uploader and want to do something with the information in the file input, you could always reset the file input with your listener function. That way the next selection would trigger a change again.
For instance:
<script type="text/javascript">
function handleInput(e) {
console.log('change occurred', e);
// Do Something with your input value
document.getElementById('#file').value = ''; // Reset your input
}
var $el = document.getElementById('#file');
$el.addEventListener('change', handleInput, false);
</script>