<input
  type="text"
  id="inp1"
  placeholder="Type something here..."
/>
<p id="p1">... and live update here</p>
// When an arrow function needs just one
// single argument (evt) and it has just
// one single instruction,
// then we can omit almost all the
// parenthesys: () {}
const onChange = evt =>
  document
    .getElementById('p1')
    .innerHTML = evt.target.value

// Try different input events:
// - keydown
// - keyup
// - change
//
// How does the behavior differ?
document
  .getElementById('inp1')
  .addEventListener('keydown', onChange)

// Challenge:
// can you rewrite this in one single
// instruction?

Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.