arimelody.me/public/script/music.js
ari melody 27d6e4f011 first commit! 🎉
Signed-off-by: ari melody <ari@arimelody.me>
2024-08-31 01:52:17 +01:00

16 lines
579 B
JavaScript

document.querySelectorAll("h2.question").forEach(element => {
element.onclick = (e) => {
const url = `${window.location.protocol}//${window.location.host}${window.location.pathname}#${e.target.id}`;
window.location = url;
};
});
document.querySelectorAll("div.music").forEach(element => {
console.log(element);
element.addEventListener("click", (e) => {
const url = `${window.location.protocol}//${window.location.host}/music/${element.id}`;
window.location = url;
});
});