How do I reference the value of an input in jQuery?
<p>I'm currently using the following method to return a value from a div:</p>

<pre><code>&lt;div data-post-id="1"&gt;
   &lt;a&gt;Add To Favourites&lt;/a&gt;
&lt;div&gt;

$(this).parent().data('post-id');
</code></pre>

<p>What I would like to do is something like this:</p>

<pre><code>&lt;div&gt;
   &lt;input type="hidden" name="postId" value="1" /&gt;
   &lt;a&gt;Add To Favourites&lt;/a&gt;
&lt;div&gt;
</code></pre>

<p>Keep in mind:</p>

<ol>
<li><p>There will be several posts on each page. Each div containing a post will have it's own input.</p></li>
<li><p>The value of the postId will not be accessible from my JS file. So the its reference has to be retrieved via JavaScript somehow.</p></li>
</ol>

<p>I want to get away from using parent() and use a single reference for each post's id, regardless whether the action is to favourite, send to a friend, etc...</p>
