-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestPage.html
70 lines (66 loc) · 1.83 KB
/
TestPage.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="content-type" content="charset=utf-8;text/html">
<script src="jquery-1.8.3.min.js" type="text/javascript"></script>
<script>
function check(obj) {
var tValue = document.getElementById("tValue");
tValue.select();
tValue.focus();
alert('message');
return false;
}
$(function () {
var a="5";
alert(a===5);
});
$(function () {
//$("#testDiv").empty();
//$("#testDiv").html("<span>test test</span>");
try{
// alert(lastElementPlusTen([]));
var div=$("div[id='testDiv'][style*='block']");
alert(div.size());
}
catch (error){
alert("Something went wrong:"+error);
}
});
function lastElement(array) {
if (array.length > 0) {
return array[array.length - 1];
}
else {
throw "Cannot take the last element of an empty array.";
}
}
function lastElementPlusTen(array) {
return lastElement(array) * 10;
}
</script>
</head>
<body>
<input type="text" name="cbAll" onchange="check()" id="tValue"/>
<br/>
<input type="button" name="tValue2" id="tValue2" onclick="SelectDiv()"/>
<ul>
<li>
<a href="" target="_blank">test1</a>
</li>
<li>
<a href="" target="_blank">test2</a>
</li>
<li>
<a href="" target="_blank">test3</a>
</li>
</ul>
<div id="testDiv" style="border:1px solid red;display:block;">
<a href="http://www.baidu.com" target="_blank" id="aLink">测试链接</a> Test Drive
</div>
<div>
<span title="Title Test">Title Test</span>
</div>
</body>
</html>