How would I add keyup to this code?

I think it’s keyup,

So that pressing enter on the keyboard will work also.

(function iife() {
  "use strict";
  const player = document.getElementById("player");
  const button = document.getElementById("button");
  const value = document.getElementById("input");
  const sent = document.getElementById("sent");

  button.addEventListener("click", function() {
    if (player.paused) {
      player.play();
    } else {
      player.pause();
    }
  });
  sent.addEventListener("click", function() {
    player.src = value.value;
    player.volume = 1.0;

  });
}());

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.