首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

练手的

2012-06-30 
练手的~!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/

练手的~
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
table{border-collapse:collapse;}
td {height:30px; border:1px solid #CCC; padding:5px;}
input{height:20px; border:1px solid #CCC; padding:0 5px;}
</style>
<script>
function calculate(){
var principal = document.loandata.principal.value;
var interest = document.loandata.interest.value / 100 / 12;
var payments = document.loantata.years.value * 12;
var x = math.pow( 1 + interest, payments);

};
</script>
</head>

<body>
<form name="loandata">
<table width="200" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>111111111111111</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>aaaaaa</td>
    <td><input type="text" name="principal" onchange="calculate();" /></td>
  </tr>
  <tr>
    <td>bbbb</td>
    <td><input type="text" name="interest" onchange="calculate();" /></td>
  </tr>
  <tr>
    <td>cccc</td>
    <td><input type="text" name="years" onchange="calculate();" /></td>
  </tr>
  <tr>
    <td></td>
    <td><input type="button" value="comput" onclick="calculate();" /></td>
  </tr>
  <tr>
    <td>222222222222</td>
    <td></td>
  </tr>
  <tr>
    <td>a2</td>
    <td><span id="payment"></span></td>
  </tr>
  <tr>
    <td>b2</td>
    <td><span id="total"></span></td>
  </tr>
  <tr>
    <td>c2</td>
    <td><span id="totalinterest"></span></td>
  </tr>
</table>
</form>
</body>
</html>

热点排行