简单的说就是focus()不支持冒泡而focusin()支持冒泡
举例说明:
html
如果是focus(),则必须写出成
$('input').on('focus',function(){
alert(123);
});写成
$('#p1').on('focus',function(){
alert(123);//无效
});而focusin()
写成
$('#p1').on('focusin',function(){
alert(123);//有效
$('#p1').off('focusin');
});
简单的说就是focus()不支持冒泡而focusin()支持冒泡
举例说明:
html
如果是focus(),则必须写出成
$('input').on('focus',function(){
alert(123);
});写成
$('#p1').on('focus',function(){
alert(123);//无效
});而focusin()
写成
$('#p1').on('focusin',function(){
alert(123);//有效
$('#p1').off('focusin');
});










