Translate

2012年7月6日 星期五

讓輸入欄位只能輸入數字(So that the input field can only enter a number)

<html>
  <head>
             <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <title></title>
  </head>
  <body>
             <input type="text" name="input" onkeyup="this.value=this.value.replace(/[^0-9]/g,'')">
  </body>
</html>

沒有留言:

張貼留言