//点击关闭按钮 input框不触发失去焦点事件
document.getElementById('js_close').onmousedown=function(e){
    if ( e && e.preventDefault ){
        e.preventDefault();
    }else{
        window.event.returnValue = false;
    }
    return false;
  
  };

preventDefault() 方法阻止元素发生默认的行为(例如,当点击提交按钮时阻止对表单的提交)。

window.event.returnValue=false//IE

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-29
猜你喜欢
  • 2022-12-23
  • 2021-12-20
  • 2021-12-19
  • 2022-12-23
  • 2021-07-03
  • 2022-12-23
相关资源
相似解决方案