Skip to content

Commit 3aa5175

Browse files
committed
khởi tạo
0 parents  commit 3aa5175

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

index.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<button id="ASong" onClick="playPause()">
2+
<audio src="https://ff83c814-a2d5-4105-9a45-be3bec448ed7.mdnplay.dev/shared-assets/audio/t-rex-roar.mp3"></audio>
3+
Song
4+
</button>
5+
6+
<span id="text"></span>
7+
<script>
8+
const aud = document.getElementById("ASong").children[0];
9+
const isPlaying = false;
10+
aud.pause();
11+
12+
function playPause() {
13+
if (isPlaying) {
14+
aud.pause();
15+
} else {
16+
aud.play();
17+
}
18+
isPlaying = !isPlaying;
19+
}
20+
const list = ["a", "b", "c", "d"]
21+
document.getElementsByTagName("span")[0].innerHTML=list.at(list.length*Math.random())
22+
</script>

0 commit comments

Comments
 (0)