点击特定区域 input框不触发失去焦点事件

//给特定区域添加ID   绑定onmousedown 事件
 document.getElementById('customModelItemMatch').onmousedown=function(e){
            //现代浏览器阻止默认事件
            if ( e && e.preventDefault )
                e.preventDefault();
            //IE阻止默认事件
            else
                window.event.returnValue = false;
            return false;
        };

猜你喜欢

转载自blog.csdn.net/qq_40095973/article/details/82343654