小需求,高手帮忙解决下
需求如下:
1、初始页面:
2、在两个文本框中输入数据,然后点击按钮,显示第三行数据
小水=(煤样第一次称重-煤样第二次称重)/煤样第一次称重
附页面代码:
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title></head><body> <center> <form> <table> <tr> <td style=" font-size:small; WIDTH: 45%; TEXT-ALIGN: right">第一次煤样称重:</td> <td style="TEXT-ALIGN: left;size:12"><input type="text" name="firstweight"/></td> </tr> <tr> <td style=" font-size:small; WIDTH: 45%; TEXT-ALIGN: right">第二次煤样称重:</td> <td style="TEXT-ALIGN: left;size:12"><input type="text" name="firstweight"/></td> </tr> <tr> <td style=" font-size:small; WIDTH: 45%; TEXT-ALIGN: right"></td> <td style="TEXT-ALIGN: left;size:12"> <input type="button" value="计算小水" name="firstweight"/></td> </tr> <tr style="display:none"> <td style=" font-size:small; WIDTH: 45%; TEXT-ALIGN: right">小水:</td> <td style="TEXT-ALIGN: left;size:12"><input type="text" name="firstweight"/></td> </tr> </table> </form> </center></body></html>
<table>
<tr>
<td style=" font-size:small; WIDTH: 45%; TEXT-ALIGN: right">第一次煤样称重:</td>
<td style="TEXT-ALIGN: left;size:12"><input type="text" name="firstweight" id="txt_firstweight"/></td>
</tr>
<tr>
<td style=" font-size:small; WIDTH: 45%; TEXT-ALIGN: right">第二次煤样称重:</td>
<td style="TEXT-ALIGN: left;size:12"><input type="text" name="firstweight" id="txt_twoweight"/></td>
</tr>
<tr>
<td style=" font-size:small; WIDTH: 45%; TEXT-ALIGN: right"></td>
<td style="TEXT-ALIGN: left;size:12"> <input type="button" value="计算小水" name="firstweight" id="btn_js"/></td>
</tr>
<tr style="visibility:hidden" id="tr_msg">
<td style=" font-size:small; WIDTH: 45%; TEXT-ALIGN: right">小水:</td>
<td style="TEXT-ALIGN: left;size:12"><input type="text" name="firstweight" id="txt_jg"/></td>
</tr>
</table>
</body>
</html>
是这样吗?