order of javascript events?
<p>I have a "a.adress" element in a div. on blur, the div dissapears. Whenever I click the a.adress element, I want the value of the a element to populate a field.(the same that gets blurred.</p>

<p>This is what I expected to work:</p>

<pre><code>$('.field').blur(function() {
  $("a.adress").click(function() {
    event.preventDefault();
    $(this).parent().parent().parent().parent().prev(".field").val($(this).text());
  });
  $(this).next('.spacer').children().removeClass("visible");
});
</code></pre>

<p>Each part works seperately, </p>

<p>this hides the div</p>

<pre><code>$('.field').blur(function() {
  $(this).next('.spacer').children().removeClass("visible");
});
</code></pre>

<p>this populates the field:</p>

<pre><code>  $("a.adress").click(function() {
    event.preventDefault();
    $(this).parent().parent().parent().parent().prev(".field").val($(this).text());
  });
</code></pre>

<p>sample page:
<a href="http://dev.resihop.nu/addtrip?from=&amp;to=&amp;when=&amp;name=&amp;email=&amp;phone=&amp;details=&amp;posted=&amp;got_car=1" rel="nofollow">http://dev.resihop.nu/addtrip?from=&amp;to=&amp;when=&amp;name=&amp;email=&amp;phone=&amp;details=&amp;posted=&amp;got_car=1</a></p>

<p>But when I put them together, I don't manage to populate the label. How do I make it work?</p>
