Skip to content

Commit d17caa2

Browse files
committed
Create blank_alink.md
1 parent 1e32976 commit d17caa2

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

JavaScriptBook/code/blank_alink.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
### 空连接 跳转
2+
3+
```
4+
<html>
5+
<head>
6+
<title>test link </title>
7+
</head>
8+
<body>
9+
<div style="background:green;height:90px;"> <a id="alink" onclick="myJsFunc()" href="javascript:void(0)">this is div and linke</a> </div>
10+
</body>
11+
</html>
12+
<script type="text/javascript">
13+
function myJsFunc(){
14+
alert('link link to www.google.com')
15+
if(confirm('gogo?')){
16+
window.location.href="www.google.com"
17+
}
18+
}
19+
</script>
20+
```

0 commit comments

Comments
 (0)