禁掉 a 标签浏览器默认行为

document.querySelector('a').onclick = (event) => {
      event = event || window.event
      event.preventDefault();
      event.returnValue = false;
}

 

posted @ 2023-04-24 15:33  Action_swt  阅读(12)  评论(0编辑  收藏  举报