用正則表達式限制input輸入框只能輸入整數的一段簡單代碼

要實現input框只能輸入正整數,若是檢測到輸入其餘類型的數據就直接爲0;代碼以下: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> </head> <body> <input type="text" οnkeyup="NumCheck(this)" /> <script> f
相關文章
相關標籤/搜索