Jquery how to check if a input has a number higher then 99

后端 未结 8 1181
离开以前
离开以前 2021-01-06 05:08

Was wanting to know how to check using jquery if a input contains a number higher then 99

8条回答
  •  被撕碎了的回忆
    2021-01-06 05:21

    This would do it

    var value = $("input selector").eq(0).val();
    if(isNaN(value)){
     //do stuff
    }
    
    else{
    var num = value - 0;
    if(num>99)
    {
     //value is greater than 99
    }
    
    }
    

提交回复
热议问题