My code has a textbox called 'answer_textbox'. When the user types in their answer into the textbox and presses enter, some jQuery code is supposed to take place. First of all i don't know how to have multiple if conditions. Are they supposed to be like this?
if($('#answer_textbox').val() == 4 && 'four') {
After that code is executes i have a else if that has a alert box that pops up is the user spells 'for' instead of 'four' for the answer.
if($('#answer_textbox').val() == 'for') {
alert('FOUR you moron');
}
But this will only work when the user spells 'for' without putting a space after spelling it. Like if they spelled 'for' and put one single space after it it wouldn't work. How do i fix this?