Last active
March 6, 2019 11:11
-
-
Save harucsx/3ac7bfad3aaffc20d81e4ec2fd8ecdb7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <script> | |
| function add(){ | |
| var num1 = document.getElementById('num1'); | |
| var num2 = document.getElementById('num2'); | |
| var result = document.getElementById('result'); | |
| var answer = parseInt(num1.value) + parseInt(num2.value); | |
| result.innerText = answer; | |
| } | |
| </script> | |
| </head> | |
| <body> | |
| <input id="num1" onchange="add()"/> + | |
| <input id="num2" onchange="add()"/> = | |
| <span id="result">?</span> | |
| <br/> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment