js正则表达式校验正数、负数、和小数:^(\-|\+)?\d+(\.\d+)?$

"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
"http://www.w3.org/1999/xhtml">

    
    


    "txtNumber" name="txtNumber" type="text" />
    "btnValidation" name="btnValidation" type="button" value="校验" οnclick="validation()" />
    验证结果:

 
  
 
  
 
  
 
  
 
  
 
  
文章来源于:http://www.cnblogs.com/lengzhan/p/6042309.html
 
 

你可能感兴趣的:(js正则表达式校验正数、负数、和小数:^(\-|\+)?\d+(\.\d+)?$)