title: Fastest way to get access to the following value with jQuery
body: <p>I seem to have some difficulty understanding the way these jQuery selectors work.</p>
  
  <p>Say you have this sort of html</p>
  
  <pre><code>&lt;form&gt;
      &lt;input type="hidden" name="something" value="1" class="class_name" /&gt;
  
      &lt;div&gt;
          &lt;input class="blur_function" name="email" /&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And the following jQuery</p>
  
  <pre><code>$(document).ready(function(){
  
     $('.blur_function').live('blur',function(){
  
         // get the value of the hidden input above 
         var something = $(this).prev('.class_name').val();
  
     });
  
  });
  </code></pre>
  
  <p>I would imagine this 'prev('.class_name') would traverse upwards in the code until it hits something with class="class_name", however I end up with <em>undefined</em> since it traverses only within the element its inside.</p>
  
  <p>So I need to do something like this to get outside the parent div and within the scope of the previous .class_name:</p>
  
  <pre><code>  var something = $(this).parent().prev('.class_name').val();
  </code></pre>
  
  <p>Is there a faster way to do this using the same html structure?</p>