get a value with javascript from a element with a link/button
<p>When i click on the link which has the id bob i want it to close the chat but also give the value of the hidden input shown below.</p>

<pre><code>&lt;div id="chat" class="chat"&gt;
    &lt;div id="ch" class="ch"&gt; 
        &lt;label id="name1"&gt;bob&lt;/label&gt;
        &lt;a id="bob" onclick="closechat(this.id)"&gt;x&lt;/a&gt;  &lt;--- LINK I CLICK ON 
    &lt;/div&gt;
    &lt;input type="hidden" name="to" id="to" value="bob"&gt;  &lt;-- HIDDEN VALUE I WANT 
    &lt;input type="hidden" id="chatboxid" value="chatbox"&gt; 
    &lt;div class="chatbox" id="chatbox" style="display: none; "&gt; 
        &lt;div class="messages"&gt;&lt;/div&gt;
        &lt;textarea name="message" id="message" class="chatinp" rows="3" cols="27"&gt;
        &lt;/textarea&gt;
        &lt;button class="send" onclick="submitmessage()"&gt;Send&lt;/button&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>the link i click gives me a id which is the id of a user and then it will close that chatbox 
but i need the hidden value as it stores the value of a needed id so i can use <strong>JQUERY</strong>
to close it.</p>

<p>oh and this gets clones so the elements ids keep on changing everytime i clone it.</p>
