title: jQuery .preventDefault();
body: <p>I have a 2 jQuery scripts- one before I added .preventDefault, and a copy of the same script after I added the .preventDefault. jQuery works in the initial, but not after I add .preventDefault()</p>
  
  <p>Initial script that works</p>
  
  <pre><code>$(window).load(function(){  
         $(document).ready(function(){  
           $("span[id$='_ff5_1']").each(function() { //returns a collection of elements that must be iterated through using each
              if ($(this).text() == "Yes") { //test value returned from non-input field
                  clearID(); 
                  $("tr.anon").hide(); 
              } else {
                  $("tr.anon").show();
              }   
           });
           if ($("select[title='action']").val() == "") {   
             $("tr.actDet").hide();      
           }
           $("select[title='organizationalElement']").focusout(function() {          
             if ($(this).val() === "I don\'t know") {             
               alert("If no organizational element is selected, additional time may be required to route this request");         
             } // close if    
              $("select[title='action']").change(function(){         
                 $(".actDet").toggle($(this).val()!= "");     
              }); // close action.change
          });//close select.focusout
         }); // close doc.ready 
      }); // close window.load 
  </code></pre>
  
  <p>Script that does not work... </p>
  
  <pre><code>$(window).load(function(){  
     $(document).ready(function(){  
       $("span[id$='_ff5_1']").each(function() { //returns a collection of elements that must be iterated through using each
          if ($(this).text() == "Yes") { //test value returned from non-input field
              clearID(); 
              $("tr.anon").hide(); 
          } else {
              $("tr.anon").show();
          }   
       });
       if ($("select[title='action']").val() == "") {   
         $("tr.actDet").hide();      
       }
       $("select[title='organizationalElement']").focusout(function() {          
         if ($(this).val() !== "I don\'t know") {
           $(this).preventDefault();
         } else {             
           alert("If no organizational element is selected, additional time may be required to route this request");         
         } // close if    
          $("select[title='action']").change(function(){         
             $(".actDet").toggle($(this).val()!= "");     
          }); // close action.change
      });//close select.focusout-- close edit record stuff
     }); // close doc.ready 
  }); // close window.load 
  </code></pre>
  
  <p>The only change I made is the initial if statement becomes an if/else that calls .preventDefault(). The first script works great, but the second script fails. Why? I'm calling the .preventDefault() method if the value of the organizationalElement is idk on an existing record.</p>
  
  <p>@Andrew: To clarify on your edit... Should I revise my script to: 
  ...</p>
  
  <pre><code>   if ($(this).val() !== "I don\'t know") {
       $(this).click( function(e) { e.preventDefault(); } );
     } else {             
       alert("If no organizational element is selected, additional time may be required to route this request");         
     } // close if
  </code></pre>
  
  <p>...
  b/c I noted taht it will work correctly if I change $(this).preventDefault(); to e.preventDefault();</p>
  
  <p>Are you perhaps trying to show how to write it if I wish to attach the method to the $(this) object as I'd originally written it?</p>