Home > Net >  how to remove the even listener after the array is finished
how to remove the even listener after the array is finished

Time:10-30

I'm playing with JS but I'm just a beginner. I guess this way works out for me the best. I want to start a dialog as an event listener by creating new divs with elements of the conversation. I also set the timeInteval after the function is called. How can I avoid displaying "the end" numerous times after the button is clicked again.

  <button id="btn">Start the conversation</button>
  const btn = document.querySelector("#btn");
  const container = document.querySelector(".container");

  const dialog = [
  "           
  • Related