Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<h1>InputEvents</h1>
<h2>The data Property</h2>
<p>The data property returns the character(s) that was inserted with the event.</p>
<p>Write something in the text field:</p>
<input type="text" oninput="myFunction(event)">
<p>The inserted character(s): <span id="demo"></span></p>
<script>
function myFunction(event) {
  let text = event.data;
  document.getElementById("demo").innerHTML = text;
}
</script>
</body>
</html>