function getfocus() {document.getElementById('myAnchor').focus()} function losefocus() {document.getElementById('myAnchor').blur()}
<a id="myAnchor" href="http://jsrun.net">访问 JSRUN.NET</a> <br> <br> <input type="button" onclick="getfocus()" value="获得焦点"> <input type="button" onclick="losefocus()" value="失去焦点">