mirror of
https://github.com/balkian/my_calculator_2.git
synced 2024-11-22 07:22:29 +00:00
1/x button
This commit is contained in:
parent
b95b431fc2
commit
5af6569228
@ -9,6 +9,10 @@ function square() {
|
|||||||
var num = document.getElementById("n1");
|
var num = document.getElementById("n1");
|
||||||
num.value = Math.pow(num.value, 2);
|
num.value = Math.pow(num.value, 2);
|
||||||
}
|
}
|
||||||
|
function inverse() {
|
||||||
|
var num = document.getElementById("n1");
|
||||||
|
num.value = Math.pow(num.value, -1);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@ -17,5 +21,6 @@ Number:
|
|||||||
<input type="text" id="n1"><p>
|
<input type="text" id="n1"><p>
|
||||||
<button onclick="cube()"> x^3 </button>
|
<button onclick="cube()"> x^3 </button>
|
||||||
<button onclick="square()"> x^2 </button>
|
<button onclick="square()"> x^2 </button>
|
||||||
|
<button onclick="inverse()"> 1/x </button>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
Reference in New Issue
Block a user