Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <body>
- <p>
- On input:
- <input type="text" oninput="myFunction('myInput1')" id="myInput1">
- </p>
- <p>
- On change:
- <input type="text" onchange="myFunction('myInput2')" id="myInput2">
- </p>
- <p id="myOutput"></p>
- <script>
- function myFunction(inputId) {
- let myInput = document.getElementById(inputId);
- let myOutput = document.getElementById("myOutput");
- myOutput.innerHTML = myInput.value;
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement