Implementation method for only entering numbers in text boxes (compatible with IE Firefox)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Unt titled document</title><script language="javascript" type="text/javascript"> //Note: When Firefox uses event, function inputNum(evt){ //Firefox uses evt.which to get the keyboard key value, IE uses window.event.keyCode to get the keyboard key value var ev = evt.which?evt.which:window.event.keyCode; if(ev>=48&&ev<=57){ return true; }else{ return false; } } </script> </head><body> <input type="text" onKeyPress="return inputNum(event);" > </body></html>The above is the entire content of the text box that can only enter numbers (compatible with IE Firefox) brought to you. I hope everyone supports Wulin.com~