Determine whether the input is a number. Ultimate solution

Real-time monitoring: input space, the resulting digital sum is 0;

Solve the space bug:

c;

if (parseFloat(a).toString() == “NaN”) {

     //alert(“请输入数字……”);
    c = a + b
     return false ;
  } else {
     return true ;
  }

Guess you like

Origin www.cnblogs.com/mangwusuozhi/p/11703620.html