js拦截alert对话框另类应用 2020-02-16 分类:JavaScript 标签Tags:js,拦截,alert,对话框,另类,应用,实现,代码,如下,input,type,button,onclick,opened,value,提示,script,var,myalert,window
实现代码如下: <input type="button" onclick="opened('ALERT')" value="提示"/> <script> var myAlert=alert; window.alert=function(msg){ //your code myAlert (msg+"-TEST"); } function opened(msg){ alert(msg); } </script> 以上就是【js拦截alert对话框另类应用】的全部内容了,欢迎留言评论进行交流!