.val() form validation question

.val() form validation question

    I am trying to validate a users input to a math question to verify they are not a bot, I am unsure how to check the input as you can see here i have   if(verify.val() != 10){  (the answer to the question is always 10) it doesn't work so i'm obviously doing it wrong, could anyone point me in the right direction?
    1. function validateBot(){
    2. //it's NOT valid
    3. if(bot.val() != 10){
    4. bot.addClass("error2");
    5. botInfo.text("You're not a robot are you?");
    6. }
    7. //it's valid
    8. else{
    9. bot.removeClass("error2");
    10. bot.addClass("success2");
    11. }