-
Notifications
You must be signed in to change notification settings - Fork 0
/
hanging-munchkin-test.html
73 lines (69 loc) · 1.89 KB
/
hanging-munchkin-test.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
71
72
73
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="./jquery-3.1.1.min.js"></script>
<title>Hanging-Munchkin Tests</title>
</head>
<body>
<ul>
<li>
<label for="aLink">1.</label><a id="aLink">This is a link</a>
</li>
<li>
<label for="aButton">2.</label><button id="aButton">This is a button</button>
</li>
<li>
<label for="divToggle">3.</label><button id="divToggle">Toggle Div</button>
</li>
<li>
<form id="aForm">
<input type="text" id="Field1" name="Field1" />
<input type="text" id="Field2" name="Field2" />
<input type="button" id="submitButton" value="click me"/>
</form>
</li>
</ul>
<p id="aParagraph">
this is a paragraph
</p>
<div id="aDiv" style="display: none;">
This is a div that is initially hidden
</div>
<div id="theArea">
The area
</div>
<div id="showOnMouseOverDiv" style="display: none;">
This div shows on mouseover of "the area"
</div>
</body>
<script>
$("#aLink").off("click").on("click", function(){
$("#aParagraph").text("The link was clicked");
});
$("#aButton").off("click").on("click", function(){
$("#aParagraph").text("The button was clicked");
});
$("#divToggle").off("click").on("click", function(){
$("#aDiv").toggle();
});
$("#aForm").submit(function(ev){
ev.preventDefault();
});
$("#submitButton").off("click").on("click", function(ev){
ev.preventDefault();
var val1= $("#Field1").val(),
val2 = $("#Field2").val();
$("#aParagraph").text(val1 + ": " + val2);
})
$("#theArea")
.off("mouseover")
.on("mouseover", function(){
$("#showOnMouseOverDiv").show();
})
.off("mouseout")
.on("mouseout", function(){
$("#showOnMouseOverDiv").hide();
})
</script>
</html>