      start();
    }
  }
});

function start() {
  p = document.createElement('p');
  words.appendChild(p);
  promise = new Promise((resolve) => {
    recognition.addEventListener('end', resolve, { once: true });
  });
  
  recognition.start();
}

document.body.addEventListener('click', () => {
  p.remove();
  start();
}, {once: true});
// start();
  </script>
</body>
</html>