1

Just one of those times when I just can't see the problem. It appears to be the opening brace at the end of the if statement.

  $('#title_number').change(function () {
    if ($('#title_number').val() == 73) or ($('#title_number').val() == 74) {
    $('#ProfessorDiv').show();
    }
  });
2
  • 2
    There is no or keyword in JavaScript, and the entire expression used by the if must be in (). Commented Jul 30, 2013 at 3:26
  • 1
    Jiminey Christmas! How many time have I coded an or statement. embarassing. Commented Jul 30, 2013 at 3:36

1 Answer 1

4

Your if statement is malformed (parenthesis grouped or, not the entire expression):

if ($('#title_number').val() == 73 || $('#title_number').val() == 74) {
  $('#ProfessorDiv').show();
}

Also there is no such logical operator as or. You meant ||.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.