HTML DOM blur() 方法
定義和用法
blur() 方法用于從鏈接上移開焦點(diǎn)。
語法
anchorObject.blur()
實(shí)例
<html> <head> <style type="text/css"> a:active {color:green} </style> <script type="text/javascript"> function getfocus() {document.getElementById('myAnchor').focus()} function losefocus() {document.getElementById('myAnchor').blur()} </script> </head> <body> <a id="myAnchor" href="http://www.dbjr.com.cn">Visit jb51.net</a> <br /><br/> <input type="button" onclick="getfocus()" value="Get focus"> <input type="button" onclick="losefocus()" value="Lose focus"> </body> </html>