http://www.jq22.com/jquery-info324
jQuery键盘插件Virtual Keyboard
不会做手机的,做了个电脑上能用的...
<script>
function demo(obj,tip){
if(tip==1){
var con=document.getElementById('content').value;
document.getElementById('content').value=con+obj.innerHTML;
}else if(tip==2){
document.getElementById('content').value="";
}else if(tip==3){
var con=document.getElementById('content').value;
document.getElementById('content').value=con.slice(0,-1);
}
}
</script>
<button οnclick="demo(this,1)">7</button>
<button οnclick="demo(this,1)">8</button>
<button οnclick="demo(this,1)">9</button>
<br>
<button οnclick="demo(this,1)">4</button>
<button οnclick="demo(this,1)">5</button>
<button οnclick="demo(this,1)">6</button>
<br>
<button οnclick="demo(this,1)">1</button>
<button οnclick="demo(this,1)">2</button>
<button οnclick="demo(this,1)">3</button>
<br>
<button οnclick="demo(this,2)">C</button>
<button οnclick="demo(this,1)">0</button>
<button οnclick="demo(this,3)">X</button>
<br>
<input type="text" id="content" />