Events - onchange and onclick pitfalls
Instructions: Change the value of the input fields and press afterwards the button. Check your console output!
Make sure to test with different browsers because you'll see different behaviors. I tested with Safari 12.1.2, Chrome 76, Firefox 68.0.2, IE 11.
1. works as expected: two events are always fired in correct order
2. works as expected: two events are always fired in correct order
Make me green in 'onChange'
3. Attention: only onchange is fired on very first click (all browsers)
Hide me in 'onChange'
4. Attention: only onchange is fired in Chrome/IE11/Safari
Show alert() in 'onChange'
5. Attention: onchange is fired AFTER onmousedown (all browsers)
Show alert() in 'onChange'
6. Attention: only onchange is fired, onmouseup is not fired at all in Chrome/Safari
Show alert() in 'onChange'