글수 22
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD> <TITLE> New Document </TITLE> </HEAD>
<script>
function ff(){
var str ='v.value = ' + v.value;
// alert(str);
eval(str);
}
</script>
<BODY>
<input id=v value="0"><br>
<input id=b type=button value=" = " onclick="ff();">
</BODY>
</HTML>



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD> <TITLE> New Document </TITLE> </HEAD>
<script>
function ff(){
var str ='v.value = ' + v.value;
// alert(str);
eval(str);
}
function f2(obj){
if(obj.value=='C')
v.value='0';
else{
if(v.value=='0') v.value='';
v.value = v.value.concat(obj.value);
}
}
</script>
<BODY>
<input id=v value="0"><br>
<input id=b type=button value=" = " onclick="ff();">
<input id=bp type=button value="C" onclick="f2(this);">
<input id=bp type=button value="+" onclick="f2(this);">
<input id=bp type=button value="*" onclick="f2(this);">
<input id=bl type=button value="(" onclick="f2(this);">
<input id=br type=button value=")" onclick="f2(this);"><br>
<input id=b1 type=button value="1" onclick="f2(this);">
<input id=b2 type=button value="2" onclick="f2(this);">
<input id=b3 type=button value="3" onclick="f2(this);"><br>
<input id=b4 type=button value="4" onclick="f2(this);">
<input id=b5 type=button value="5" onclick="f2(this);">
<input id=b6 type=button value="6" onclick="f2(this);"><br>
<input id=b4 type=button value="7" onclick="f2(this);">
<input id=b5 type=button value="8" onclick="f2(this);">
<input id=b6 type=button value="9" onclick="f2(this);"><br>
<input id=b6 type=button value="0" onclick="f2(this);"><br>
</BODY>
</HTML>