テキストボックスに番号のみを入力するための実装方法(IE Firefoxと互換性があります)
< xmlns = "http://www.w3.org/1999/xhtml"> <head> <meta http-equiv = "content-type" content = "text/html; charset = utf-8"/> <title> untled document </titcript "> <"> <"> <"> <"> <"> <"> <fire fireイベント、function inputnum(evt){// firefoxはevtを使用します。キーボードキー値を取得するには、window.event.keycodeを使用してキーボードキー値var ev = evt.which?evt.which:window.event.keycodeを取得します。 if(ev> = 48 && ev <= 57){return true; } else {return false; }} </script> </head> <body> <入力タイプ= "text" onkeypress = "return inputnum(event);" > </body> </html>上記は、テキストボックスのコンテンツ全体で、数字のみを入力できます(IE Firefoxと互換性があります)。誰もがwulin.comをサポートすることを願っています〜