Why does onchange fire before it appears in Chrome?

I would still take advantage of the experience and capabilities of this community.
My question is: why, if we have code similar to

<input name="" type="checkbox"  onClick="first()" onChange="second()">
<script type="text/javascript">
function first(){
    console.log('first')
    }
function second(){
    console.log('second')
    }
</script>

in firefox onclick event fires before onchange, but in chrome - vice versa?
Thanks for your answers, maybe I didn’t explain in the best way.
I know that with onMuseDown the problem is solved, but I want to understand the reason for this behavior in Chrome with the onchange and onclick event

+4
source share
2 answers

Because it onChangestarts becauseonClick

+1
source

onMouseDown onClick.

, ;)

+1

Source: https://habr.com/ru/post/1537689/


All Articles