title: Javascript prompt() - cancel button to terminate the function
body: <p>I'm calling a Javascript <code>window.prompt()</code> and prompting the user to submit a variable which I compare to another variable (a very basic password protection). The function works great, however, if you click <code>"cancel"</code> on the <code>prompt()</code> window, the function does not simply terminate, but rather compares the variable to an empty string, (which the user opted not to submit by pressing "cancel" instead) resulting in the function continuing to the <code>else{ }</code> portion.</p>
  
  <p>My question is, how do I terminate the function upon pressing cancel? I just need to know how to target the cancel button. </p>
  
  <p>Usually I would just call a <code>.stop()</code> on the <code>click()</code> of a button, but I don't know how to target the prompt-window's cancel button.</p>