-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
31 lines (31 loc) · 831 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<!DOCTYPE html>
<html>
<head>
<title>Calculator</title>
<meta charset="utf-8">
</head>
<body>
<h1>Calculadora de Ramón Hernández García</h1>
Number:
<input type="text" id="n1">
<p>
<button onclick="cube()"> x^3 </button>
<button onclick="power_4()"> x^4</button>
<button onclick="sine()"> sin </button>
</p>
<script type="text/javascript">
function cube() {
var num = document.getElementById("n1");
num.value = Math.pow(num.value, 3);
}
function power_4() {
var num = document.getElementById("n1");
num.value = Math.pow(num.value, 4);
}
function sine() {
var num = document.getElementById("n1");
num.value = Math.sin(num.value);
}
</script>
</body>
</html>