<meta charset="utf-8">
<center>
<br>
<br>
<textarea cols=20 rows=20 id=suanshu></textarea>
<input type=button value=" " onclick="suanshu()"></input>
<textarea cols=20 rows=20 id=jieguo></textarea>
</center>
<script language="javascript">
function suanshu()
{
var s
var ars;
var i,l;
s=document.all.suanshu.value;
//String.fromCharCode(10) ;ars=s.split("\x0a"); , webkt #10 , ie #13#10 ; /\r?
/ /\r{0,1}
/。 \r 0 1 。
ars=s.split(/\r?
/);
l=ars.length;
s="";
for(i=0;i<l;i++)
{
if (s==""){
s=ars[i]+"="+eval(ars[i]);
}else{
s=s+String.fromCharCode(13)+ars[i]+"="+eval(ars[i]);
}
}
//alert(s);
document.all.jieguo.value=s;
}
</script>