|
|
|
@ -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>
|
|
|
|
|