1/x button

ops
J. Fernando Sánchez 5 years ago
parent b95b431fc2
commit 5af6569228

@ -9,6 +9,10 @@ function square() {
var num = document.getElementById("n1");
num.value = Math.pow(num.value, 2);
}
function inverse() {
var num = document.getElementById("n1");
num.value = Math.pow(num.value, -1);
}
</script>
</head>
<body>
@ -17,5 +21,6 @@ Number:
<input type="text" id="n1"><p>
<button onclick="cube()"> x^3 </button>
<button onclick="square()"> x^2 </button>
<button onclick="inverse()"> 1/x </button>
</body>
</html>

Loading…
Cancel
Save