jsp中获取当前文本框的值,且在当前页面使用该值,不涉及跳转。

来源:互联网 发布:淘宝女士内裤 编辑:程序博客网 时间:2024/05/21 08:50
 
<html><head><title>test</title><script type="text/javascript">function fun(){var price = document.getElementById('price').value;var count = document.getElementById('count').value;document.getElementById('total').value = count*price;}</script></head><body>单价:<input id='price' type='text' value='<%=price%>'>数量:<input id='count' type='text' onblur='fun()'>总额:<input id='total' type='text'></body></html>
原创粉丝点击