简体   繁体   中英

input type number on Firefox: click on spin button not fire focus event

On Chrome when users click on the spin button of the input number the focus event is fired, but not on Firefox. How fire the focus on Firefox like Chrome?

FIREFOX

在此处输入图片说明

CHROME

在此处输入图片说明

LIVE DEMO

 function onFocus(){ console.log('focused'); }
 <input type="number" onfocus="onFocus()">

Add onChange listener, inside trigger focus for input. event.target.focus()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM