Strange jQuery .prev() behaviour
<p>I have simple HTML code:</p>

<pre><code>&lt;input type='hidden' name='cat_id' value='123'/&gt;
&lt;a href='#' class='edit'&gt;Edit&lt;/a&gt;
&lt;a href='#' class='delete delete-link'&gt;Delete&lt;/a&gt;
</code></pre>

<p>And simple JS code:</p>

<pre><code>$("a.delete-link").click(function() {
var id = $(this).prev($('input[name="cat_id"]')).val();
    alert(id);
});
</code></pre>

<p>Everything simple and obvious, get a value of previous input with name 'cat_id'. But it just returns an empty string (value is really defined). I thought maybe selector is wrong:</p>

<pre><code>var id = $(this).prev($('input[name="cat_id"]')).length;
alert(id);
</code></pre>

<p>Returns 1. Working. 
I just didn't have a clue what' happening and tried</p>

<pre><code>var id = $(this).prev($('input[name="cat_id"]')).attr('name');
alert(id);
</code></pre>

<p>Returns 'undefined'. Strange. Any ideas? Tried prevAll instead of prev, effect is the same. jQuery version is 1.6.4</p>
