<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<script type="text/javascript">
function add(b){
var str = document.getElementById("into");
str.value += b;
}
function undo(){
var str = document.getElementById("into");
str.value = str.value.substring(0,str.value.length-1);
}
function clear(){
var str = document.getElementById("into");
str.value = "";
}
function closeDiv(){
document.getElementById("inputNum").style.display="none";
}
function showDiv(){
document.getElementById("inputNum").style.display="block";
}
function cancel(){
document.getElementById("inputNum").style.display="none";
document.getElementById("into").value="";
}
</script>
<body>
<div>
<input type="text" id="into" οnfοcus="showDiv()" />
<div id="inputNum" style="display:none" >
<table>
<tr>
<td><input type="button" value="1" οnclick="add(this.value)" /></td>
<td><input type="button" value="2" οnclick="add(this.value)"/></td>
<td><input type="button" value="3" οnclick="add(this.value)"/></td>
<td><input type="button" value="撤销" οnclick="undo()" /></td>
</tr>
<tr>
<td><input type="button" value="4" οnclick="add(this.value)"/></td>
<td><input type="button" value="5" οnclick="add(this.value)"/></td>
<td><input type="button" value="6" οnclick="add(this.value)"/></td>
<td><input type="button" value="清空" οnclick="clear()" /></td>
</tr>
<tr>
<td><input type="button" value="7" οnclick="add(this.value)"/></td>
<td><input type="button" value="8" οnclick="add(this.value)"/></td>
<td><input type="button" value="9" οnclick="add(this.value)"/></td>
<td><input type="button" value="取消" οnclick="cancel()"/></td>
</tr>
<tr>
<td colspan="3"><input type="button" style="width:100px;" value="0" οnclick="add(this.value)"/></td>
<td><input type="button" value="确定" οnclick="closeDiv()" /></td>
</tr>
</table>
</div>
</div>
</body>
</html>