Created
March 13, 2020 20:33
-
-
Save SaraJo/a7c26e12004ba2a42c3a4796320b20bc to your computer and use it in GitHub Desktop.
Baby Calculator
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
<html> | |
<head> | |
<style> | |
button{ | |
width: 50px; | |
height: 50px; | |
font-weight: bold; | |
} | |
input{ | |
border: 1px solid green; | |
width: 100px; | |
} | |
div{ | |
border: 1px solid grey; | |
width: 400px; | |
} | |
</style> | |
<script> | |
function add(){ | |
var first = document.getElementById("first-int").value | |
, second = document.getElementById("second-int").value; | |
window.alert(parseInt(first) + parseInt(second)); | |
} | |
</script> | |
</head> | |
<div> | |
<p> | |
<label for="first-int">first number:</label> | |
<input type="text" id="first-int" /> | |
<label for="second-int">second number:</label> | |
<input type="text" id="second-int" /> | |
</p> | |
<p> | |
<button id="add" onclick="add()">+</button> | |
<button id="subtract">-</button> | |
<button id="multiply">*</button> | |
<button id="divide">/</button> | |
</p> | |
</div> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment