<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>

<body>
<audio src="" controls autoplay id="audio"></audio>
</body>
<script>
window.onload = function() {
    var m1 = "https://www.xxhzm.cn/music/music(1).mp3";
    var m2 = "https://www.xxhzm.cn/music/music(2).mp3";
    var m3 = "https://www.xxhzm.cn/music/music(3).mp3";
    var m4 = "https://www.xxhzm.cn/music/music(4).mp3";
    var m5 = "https://www.xxhzm.cn/music/music(5).mp3";
    var m6 = "https://www.xxhzm.cn/music/music(6).mp3";
    var m7 = "https://www.xxhzm.cn/music/music(7).mp3";
    var m8 = "https://www.xxhzm.cn/music/music(8).mp3";
    var m9 = "https://www.xxhzm.cn/music/music(9).mp3";
    var m10 = "https://www.xxhzm.cn/music/music(10).mp3";
    var x = Math.round(Math.random() * 9);
    //console.log(x);
    if (x == 0) x = m1
    else if (x == 1) x = m2
    else if (x == 2) x = m3
    else if (x == 3) x = m4
    else if (x == 4) x = m5
    else if (x == 5) x = m6
    else if (x == 6) x = m7
    else if (x == 7) x = m8
    else if (x == 8) x = m9
    else x = m10
    var audio = document.getElementById("audio")
    audio.src = x

}
</script>

</html>

作者:小小孩子们
转载请注明地址
地址:https://xxhzm.cn/index.php/archives/17/

最后修改:2021 年 08 月 24 日 04 : 00 PM
如果觉得我的文章对你有用,请随意赞赏