zl程序教程

您现在的位置是:首页 >  后端

当前栏目

js取消页面超链接的方法详解编程语言

JS方法编程语言 详解 页面 取消 超链接
2023-06-13 09:20:25 时间
A href="http://www.baidu.com" 百度 /A A href="http://www.jb51.net" 脚本之家 /A A href="http://s.jb51.net" 服务器软件 /A A href="http://sc.jb51.net" 素材下载 /A A href="http://tools.jb51.net" 站长查询 /A A href="http://www.jb51.net/jiaoben/" 脚本下载 /A input type=button id=o1 value="取消所有链接" input type=button id=o2 value="重新设置链接" script function doLinkAll(action){ var arr=document.getElementsByTagName("A") for(var i=0;i arr.length;i++){ if (action){ //重新设置链接 if (arr[i].rel) arr[i].setAttribute("href",arr[i].rel) }else{ //取消所有链接 arr[i].setAttribute("rel",arr[i].href) arr[i].removeAttribute("href") o1.disabled=!action o2.disabled=action /script

原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/8832.html

cjavaphp