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

后端 未结 8 1282
离开以前
离开以前 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:18

    Simply use this:

    if ($("input.INPUTNAME").val() > 99) {
    //above 99 code
    }
    

    You may want to have an else command, if the input is below 99.

    if ($("input.INPUTNAME").val() > 99) {
        //above 99 code.
        }
    else{
         //Not above 99 code.
    }
    

提交回复
热议问题