change
event bubbles, so you can catch it when it gets to document
in the bubbling phase. focus
and blur
events don't bubble, but you can catch them on the capture phase with one event listener on document
. change
event, which is not spec compliant). So, as far as I know, the only way on IE is to register an event listener for change
, focus
, and blur
on every form control. This operation can be expensive when you have a lot of controls. But is there a better way?
jQuery 1.4定义了“ focusin”和“ focusout”来捕获所有浏览器的焦点和模糊事件。
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.