Created
October 21, 2017 15:45
-
-
Save anonymous/25fc4c2f0b8ab30908a9816585c994eb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title></title> | |
<script type="text/javascript"> | |
function max() { | |
var a = document.getElementById("txtso1").value | |
Number(a) | |
var b = document.getElementById("txtso2").value | |
Number(b) | |
var c = document.getElementById("txtso3").value | |
Number(c) | |
document.getElementById("txtkq").innerHTML = Math.max(a, b, c) | |
} | |
function min() { | |
var a = document.getElementById("txtso1").value | |
Number(a) | |
var b = document.getElementById("txtso2").value | |
Number(b) | |
var c = document.getElementById("txtso3").value | |
Number(c) | |
document.getElementById("txtkq").innerHTML = Math.min(a, b, c) | |
} | |
function cos() { | |
var b = document.getElementById("txtso2").value | |
Number(b) | |
document.getElementById("txtkq").innerHTML = Math.cos(b * Math.PI / 180); | |
b = Math.round(b * 1000) / 1000; | |
} | |
function sina() { | |
var a = document.getElementById("txtso1").value | |
Number(a) | |
document.getElementById("txtkq").innerHTML = Math.sin(a.value * Math.PI / 180); | |
a = Math.round(a * 1000) / 1000; | |
} | |
function amub() { | |
var a = document.getElementById("txtso1").value | |
Number(a) | |
var b = document.getElementById("txtso2").value | |
Number(b) | |
document.getElementById("txtkq").innerHTML = Math.pow(a, b) | |
} | |
</script> | |
</head> | |
<body> | |
<form> | |
<table> | |
<tr> | |
<td style="border:1px solid;border-collapse:collapse;width:150px" > a(Số thứ nhất)</td> | |
<td> <input type="text" id="txtso1" name="txtso1" style="width:150px" /> | |
</td> | |
</tr> | |
<tr> | |
<td style="border:1px solid;border-collapse:collapse;width:150px" > b(Số thứ hai)</td> | |
<td> <input type="text" id="txtso2" name="txtso2" style="width:150px" /> | |
</td> | |
</tr> | |
<tr> | |
<td style="border:1px solid;border-collapse:collapse;width:150px" > ca(Số thứ ba)</td> | |
<td> <input type="text" id="txtso3" name="txtso3" style="width:150px" /> | |
</td> | |
</tr> | |
<tr> | |
<td style="border:1px solid;border-collapse:collapse;width:150px" > KẾT QUẢ</td> | |
<td> <input type="text" id="txtkq" name="txtkq" style="width:150px" readonly /> | |
</td> | |
</tr> | |
</table> | |
<button type="button" id="idmax" name="idmax" value="MAX" onclick="max()">MAX</button> | |
<button type="button" id="idmin" name="idmin" value="MIN" onclick="min()">MIN</button> | |
<button type="button" id="idsina" name="idsina" value="sin(a)" onclick="sina()">sin(a)</button> | |
<button type="button" id="idcosa" name="idcosa" value="cos(a)" onclick="cos(a)">cos(a)</button> | |
<button type="button" id="idamub" name="idamub" value="a^b" onclick="amub()">a^b</button> | |
</form> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment