I just wanna clean all the screen before i display information there, why is this not working? [closed]

6 days ago 9
ARTICLE AD BOX

im trying to do my own portfolio, but i need the button pressed by user to display an information in an area, and then, when another button is pressed, the information that was displayed needs to be cleared for the new one. pls HELP! 😭

const btn = document.querySelectorAll('.botao'); const articles = document.querySelectorAll("articleclass"); btn.forEach(function(btn){ btn.addEventListener("click", event => { articles.forEach(article => article.style.display = "none"); const articleId = btn.dataset.articleid; document.getElementById(articleId).style.display = "block"; console.log(event) }); });
Read Entire Article