-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
33 lines (33 loc) · 989 Bytes
/
index.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
<!DOCTYPE html>
<html lang="kr">
<head>
<meta charset="UTF-8">
<title>POP CAT</title>
<style type="text/css">
</style>
<audio id='audio_pop1' src='./src/pop1.mp3' preload="auto"></audio>
<audio id='audio_pop2' src='./src/pop2.mp3' preload="auto"></audio>
<script>
var flag=0;
function imgToggle() {
var img1=document.getElementById("img1");
var audio1=document.getElementById('audio_pop1');
var audio2=document.getElementById('audio_pop2');
if(flag==1) {
img1.src="src/pop2.jpg";
flag=0;
audio1.play();
}
else {
img1.src="src/pop1.jpg";
flag=1;
audio2.play();
}
}
</script>
</head>
<body>
<img scr="./src/pop1.jpg" onclick="imgToggle()" id="img1">
<input type="button" value="시작" onclick="imgToggle()">
</body>
</html>