html 简单计算

来源:百度知道 编辑:UC知道 时间:2024/05/28 08:12:47
本人对html没什么研究。现在想实现这样一个功能:一个网页中有三个文本框,让浏览者输入两个数值m,n,然后计算m*100+n*10并在第三个文本框里面显示出来!!
该如何实现?如果用java Script该怎么写?
谢!!
知道问题有点白,但是希望你对我这个菜鸟心细些!!
写出完整的的html代码!!
快啊!!

还有啊!!你的代码乘法可以,怎么加的时候就是简单罗列?
象1+2=12!!

代码如下: 
<!DOCTYPE html> 
<html> 
<meta name="content-type" content="text/html; charset=UTF-8"> 
<head> 
<title>Calculator</title> 
<!--将按键内容以字符串形式存储在文字框中当按钮为“=”时,调用eval方法计算结果然后将结果输出文字框中--> 
<script type="text/javascript"> 
var numresult; 
var str; 
function onclicknum(nums) { 
str = document.getElementById("nummessege"); 
str.value = str.value + nums; 

function onclickclear() { 
str = document.getElementById("nummessege"); 
str.value = ""; 

function onclickresult() { 
str = document.getElementById("nummessege"); 
numresult = eval(str.value); 
str.value = numresult; 

</script> 
</head> 
<body bgco