Demo of the JavaScript keyup Event

Type in the input. After each key is released, the complete current value is copied to the textarea.

JavaScript

const source = document.getElementById('t1');
const output = document.getElementById('t2');

source.addEventListener('keyup', () => {
  output.value = source.value;
});

← Return to keyup tutorial Event Handling →