irmantas_radavicius

Untitled

Oct 23rd, 2021
576
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4.  
  5.  
  6. <p>
  7.     On input:
  8.     <input type="text" oninput="myFunction('myInput1')" id="myInput1">  
  9. </p>
  10. <p>
  11.     On change:
  12.     <input type="text" onchange="myFunction('myInput2')" id="myInput2">  
  13. </p>
  14.  <p id="myOutput"></p>
  15. <script>
  16. function myFunction(inputId) {
  17.     let myInput = document.getElementById(inputId);
  18.     let myOutput = document.getElementById("myOutput");
  19.     myOutput.innerHTML = myInput.value;
  20. }
  21. </script>
  22.  
  23. </body>
  24. </html>
  25.  
RAW Paste Data