网页计算器代码

经个人美化加工

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function doit() {
form.input.value = eval(form.input.value)
}
function Cos() {
x = form.input.value
if (x == '') alert('Error: Input Required');
else form.input.value = Math.cos(x);
}
function Sin() {
x = form.input.value
if (x == '') alert('Error: Input Required');
else form.input.value = Math.sin(x);
}
function Ln() {
x = form.input.value
if (x == '') alert('Error: Input Required');
else form.input.value = Math.log(x);
}
function Root() {
x = form.input.value
if (x == '') alert('Error: Input Required');
else form.input.value = Math.sqrt(x);
}
function Tan() {
x = form.input.value
if (x == '') alert('Error: Input Required');
else form.input.value = Math.tan(x);
}
function Icos() {
x = form.input.value
if (x == '') alert('Error: Input Required');
else form.input.value = Math.acos(x);
}
function Isin() {
x = form.input.value
if (x == '') alert('Error: Input Required');
else form.input.value = Math.asin(x);
}
function Itan() {
x = form.input.value
if (x == '') alert('Error: Input Required');
else form.input.value = Math.atan(x);
}
function Round() {
x = form.input.value
if (x == '') alert('Error: Input Required');
else form.input.value = Math.round(x);
}
function Ran() {
x = form.input.value
form.input.value = Math.random(x);
}
function Neg () {
x = form.input.value
if (x == '') alert('Error: Input Required');
else x = parseFloat(x) * -1;
}
function del() {
x = form.input.value
x = (x.substring) - 1
}
// End -->
</script>
<div align="center">
<form name="form" method="post" action="javascript:doit()">
<table width="260" border="0" height="260" align="center" bordercolor="#000000" bgcolor="#000000">
<tr bgcolor="#000000">
<td colspan="7" height="2">
<div align="center"><b><font face="Arial, Helvetica, sans-serif" color="#FFFFFF">高级计算器</font></b></div>
</td>
</tr>
<tr bgcolor="#000000">
<td colspan="7" height="2">
<div align="center">
<input type="text" name="input" size="40">
</div>
</td>
</tr>
<tr bgcolor="#000000">
<td width="50" height="4">
<input type="button" name="one" value="1" onClick="form.input.value += '1'" style="COLOR: #FFFFFF; BACKGROUND-COLOR: #666666; HEIGHT: 25 px; WIDTH: 40px">
</td>
<td width="50" height="4">
<input type="button" name="two" value="2" onClick="form.input.value += '2'" style="COLOR: #FFFFFF; BACKGROUND-COLOR: #666666; HEIGHT: 25 px; WIDTH: 40px">
</td>
<td width="50" height="4">
<input type="button" name="three" value="3" onClick="form.input.value += '3'" style="COLOR: #FFFFFF; BACKGROUND-COLOR: #666666; HEIGHT: 25 px; WIDTH: 40px">
</td>
<td width="20" height="4"> </td>
<td width="50" height="4">
<input type=&quo


t;button" name="clear" value="C" onClick="form.input.value = ''" style="COLOR: #FFFFFF; BACKGROUND-COLOR

你可能喜欢

  • 简易计算器
  • 网站代码
  • c#计算器
  • css+div
  • java计算器代码
  • 留言板代码

网页计算器代码相关文档

最新文档

返回顶部