Đây nhe bạn

Nãy bận không thể rep bạn được.

Bạn chèn mã js này trước thẻ đóng </body> nha

 
<script>
function HongLamStart() {
        audio.play();
      }
      const HongLam_List = [
  "//files.catbox.moe/773rdi.mp3", // Em biet anh khong yeu em
  "//files.catbox.moe/mvfj0k.mp3", // Mot duong no hoa
  "//files.catbox.moe/typrw7.mp3", // My love free beat lofi
];
//Random music
let index = Math.floor(Math.random() * HongLam_List.length);
const audio = new Audio(HongLam_List[index]);
function HongLamAudio() {
  audio.play();
}
document.addEventListener("click", HongLamAudio);
audio.addEventListener("ended", function() {
  index = (index + 1) % HongLam_List.length;
  audio.src = HongLam_List[index];
  audio.play();
});
</script>

bạn thay link nhạc bạn vô nha, nhưng mà cái này click vào một chỗ bất kì nó mới ra nhạc chứ không hẳn là auto chạy, nên bạn chèn thêm popup vào nha, kiểu khi bạn đóng popup thì nó sẽ phát ra nhạc á.


 
<body onload='thongbaopopup()'></body>
<style>
    .tbpopup .tboverlay {
        position: fixed;
        top: 0px;
        left: 0px;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.7);
        z-index: 1;
        display: none;
    }
    
    .tbpopup .tbcontent {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0);
        background: #fff;
        max-width: 500px;
        z-index: 2;
        text-align: center;
        padding: 20px;
        box-sizing: border-box;
        font-family: "Open Sans", sans-serif;
        border-radius: 20px;
        display: block;
        position: fixed;
        box-shadow: 0px 0px 10px #111;
    }
    
    @media (max-width: 700px) {
        .tbpopup .tbcontent {
            width: 90%;
        }
    }
    
    .tbpopup .tbclose-btn {
        cursor: pointer;
        position: absolute;
        right: 20px;
        top: 20px;
        width: 35px;
        height: 35px;
        color: #ff4444;
        font-size: 30px;
        font-weight: 600;
        line-height: 35px;
        text-align: center;
        border-radius: 50%;
    }
    
    .tbpopup.active .tboverlay {
        display: block;
    }
    
    .tbpopup.active .tbcontent {
        transition: all 300ms ease-in-out;
        transform: translate(-50%, -50%) scale(1);
    }
    
    .tbbuttom {
        background: #00cc00;
        color: #fff
    }
</style>
<!-- Thong bao pupup -->
<div class='tbpopup' id='tbpopup-1'>
<div class='tboverlay'></div>
<div class='tbcontent'>
<div class='tbclose-btn' onclick='thongbaopopup()'><i aria-hidden='true' class='fa fa-times-circle'></i>
</div>
<div style='font-size:30px;font-weight:bold'>Xin chào</div>
<p>Cảm ơn bạn đã ghé thăm trang web của mình, chúc bạn một ngày mới vui vẽ và tràn đầy hạnh phúc!</p>
</div>
</div>
<!-- js thong bao popup -->
<script>
    function thongbaopopup() {
        document.getElementById("tbpopup-1").classList.toggle("active");
    }
</script>
Có gì không hiểu thì để lại info mình liên hệ bạn nhé, chúc bạn thành công nhé mỹ nam.