I have set up an event Listener and I want it so that when I click, the text in the middle changes from "Bubble" to "Bounce".
document.getElementById("text").innerHTML = "Bubble";
document.addEventListener("click", next);
function next() {
document.getElementById("text").innerHTML = "Bounce"
}
section {
width: 100%;
height: 100vh;
overflow: hidden;
background: #1F69FA;
display: flex;
justify-content: center;
align-items: center;
}
section h2 {
font-size: 10em;
color: #333;
margin: 0 auto;
text-align: center;
font-family: consolas;
}
<section>
<h2 id="text"></h2>
</section>