You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

11 lines
326 B

for (let i = 1; i <= 25; i++){
let buttons = document.querySelectorAll(`#day-${i} > button`);
buttons.forEach(button => {
button.addEventListener('click', async () => {
const response = await (await fetch(button.dataset['url'])).json();
document.getElementById('response').innerText = response.result;
});
});
}