定义和用法
blur() 方法用于从链接上移开焦点。
语法
anchorObject.blur()
实例
1
<html>
2
<head>
3
<style type="text/css">
4
a:active {color:green}
5
</style>
6
7
<script type="text/javascript">
8
function getfocus()
9
{document.getElementById('myAnchor').focus()}
10
11
function losefocus()
12
{document.getElementById('myAnchor').blur()}
13
</script>
14
</head>
15
16
<body>
17
<a id="myAnchor"
18
href="http://www.w3school.com.cn">Visit W3School.com.cn</a>
19
<br /><br/>
20
<input type="button" onclick="getfocus()" value="Get focus">
21
<input type="button" onclick="losefocus()" value="Lose focus">
22
</body>
23
24
</html>
25

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25
