mirror of
https://github.com/balkian/my_calculator.git
synced 2024-11-22 07:12:28 +00:00
x^4 button
This commit is contained in:
parent
82165b0979
commit
110754aad1
@ -2,8 +2,12 @@
|
|||||||
<title>Calculator</title><meta charset="utf-8">
|
<title>Calculator</title><meta charset="utf-8">
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function cube() {
|
function cube() {
|
||||||
var num = document.getElementById("n1");
|
var num = document.getElementById("n1");
|
||||||
num.value = Math.pow(num.value, 3);
|
num.value = Math.pow(num.value, 3);
|
||||||
|
}
|
||||||
|
function fourth() {
|
||||||
|
var num = document.getElementById("n1");
|
||||||
|
num.value = Math.pow(num.value, 4);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
@ -12,5 +16,6 @@ num.value = Math.pow(num.value, 3);
|
|||||||
Number:
|
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="fourth()"> x^4 </button>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
Reference in New Issue
Block a user