"Form" with client-side only interactivity:
<input type="file" id="file" />
I'd like to avoid making another button just to trigger functionality, but:
function handleInput(e) {
console.log('change occurred', e);
// read the input with FileReader HTML5 and do stuff
}
var $el = document.getElementById('file');
$el.addEventListener('change', handleInput, false);
When I first choose a file, the event triggers. If I choose the same file again, it does not. Is there an alternative event I should use?