< input type ="text" id ="a1" value ="1" > + < input type ="text" id ="a2" value ="1" > = < input type ="text" id ="a3" readonly ="true" > < br > < input type ="button" value ="click" onclick ="foo()" > < script > function foo(){ a3.value = parseInt(a1.value) + parseInt(a2.value); } </ script > 转载于:https://www.cnblogs.com/simhare/archive/2007/10/30/943045.html