title: How do I get my nested if statement to work in jQuery
body: <p>Right now there is an input text box where users type in a word. Once they type in that word and press enter, the word disappears and a new one appears and so on. If they type it wrong the color turns red. I can only get it to work once however because something is wrong with my nested if statements.  </p>
  
  <pre><code>$(".inputText").keyup(function (event) {
      if (event.keyCode == 13) {
          var text = $('.inputText').val();
          if (text == ("example")) {
              $('.example').fadeOut('fast');
              $('.example2').fadeIn('slow');
              $('.inputText').val('');
              if (event.keyCode == 13) {
                  var text = $('.inputText').val();
                  if (text == ("example2")) {
                      $('.example2').fadeOut('fast');
                      $('.example3').fadeIn('slow');
                      $('.inputText').val('');
                  }
              }
          } else {
              $('.example').css('color', 'red');
          }
      }
  });
  </code></pre>