How would I make a UI pop-up
headiscoding (943)

For a game im making, I want to make it so that when you click the (in this case urmom), a +1 text pops up on the screen and fades away. thanks. OH YEAH THIS IS IN HTML, CSS, AND JS BTW

You are viewing a single comment. View All
Answered by RYANTADIPARTHI (6006) [earned 5 cycles]
View Answer
Coder100 (16758)

Something like:

<button id="open-modal">Click me</button>

<div id="popup">This is a popup!</div>

just add some css to make:

#popup {
  display: none;

and your js:

document.getElementById("open-modal", () => {
  document.getElementById("popup").style.display = "block";