點擊一個input觸發的事件順序:
const text = document.getElementById('text');
text.onclick = function (e) {
console.log('onclick')
}
text.onfocus = function (e) {
console.log('onfocus')
}
text.onmousedown = function (e) {
console.log('onmousedown')
}
text.onmouseenter = function (e) {
console.log('onmouseenter')
}
// 'onmouseenter'
// 'onmousedown'
// 'onfocus'
// 'onclick'