Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <input type="text" id="my_input1" />
- <input type="text" id="my_input2" />
- <input type="button" value="Add Them Together" onclick="doMath();" />
- <script type="text/javascript">
- function doMath()
- {
- var my_input1 = document.getElementById('my_input1').value;
- var my_input2 = document.getElementById('my_input2').value;
- var sum = parseInt(my_input1) + parseInt(my_input2);
- document.write(sum);
- }
- 'a'.charCodeAt(0) // 97
- let values = { a: 1, b: 2, c: 3 }
- values.a // 1
Add Comment
Please, Sign In to add comment