码迷,mamicode.com
首页 > 其他好文 > 详细

面试题

时间:2018-05-16 15:08:23      阅读:139      评论:0      收藏:0      [点我收藏+]

标签:click   a*   bsp   cin   cli   begin   orm   size   多少   

脚本说明:

把如下代码加入<body>区域中
<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
function calc1(form) {
a = form.a.value/100;
b = a*form.b.value;
form.total1.value = b;
}
function calc2(form) {
a = form.c.value;
b = form.d.value;
c = a/b;
d = c*100;
form.total2.value = d;
}

// End -->
</script>
<form name="form1">
<table border=1 cellpadding=4 cellspacing=1>
<tr>
<td align=center><input type="text" name="b" size=5>的
<input type="text" name="a" size=5>
% 是多少 ?</td>
<td align=center>答案: <input type="text" name="total1"
size=5 maxlength=40></td>
<td align=center><input type="button" value="Calculate"
onClick="calc1(this.form)"></td>
</tr>
<tr>
<td align=center colspan=3 align=center>Or...</td>
</tr>
<tr>
<td align=center><input type="text" name="c" size=5>
是<input type="text" name="d" size=5>的百分之几?</td>
<td align=center>答案: <input type="text" name="total2"
size=5> %</td>
<td align=center><input type="button" value="Calculate"
onClick="calc2(this.form)"></td>
</tr>
</table>
</form>

 


 

面试题

标签:click   a*   bsp   cin   cli   begin   orm   size   多少   

原文地址:https://www.cnblogs.com/lovelanglangyou/p/9045306.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!