forked from cypress-io/cypress-example-recipes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hidden.html
49 lines (44 loc) · 1002 Bytes
/
hidden.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
<!DOCTYPE html>
<html>
<head>
<title>Hover and Hidden Elements - Hidden</title>
<script type="text/javascript" src="/node_modules/jquery/dist/jquery.js"></script>
<style>
#background {
padding: 5px 10px;
width: 300px;
height: 150px;
background-color: #eee;
color: #777;
}
#background button {
display: none;
margin: 20px;
}
#background:hover button {
display: block;
}
</style>
</head>
<body>
<h2>
hidden.html
</h2>
<div id="background">
<p>
This is a <div> holding a hidden button which becomes visible on hover.
</p>
<button>Click me</button>
</div>
<p id="message"></p>
<script type="text/javascript">
// when our hidden button is clicked
// we want to populate <p id="message">
// so we can test how this event is triggered
// by Cypress
$("button").click(function(){
$("#message").text("the button was clicked")
})
</script>
</body>
</html>