<html>
<body>
<form name=form1>
<input name="textfield2" type="text" onKeyUp="value=value.replace(/[^\d]/g,'');" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))">
</form>
</body>
</html>
代碼說明:
onKeyUp是鍵盤彈起事件。
posted on 2006-11-24 13:22
kelly 閱讀(196)
評論(0) 編輯 收藏 所屬分類:
java