Jquery how to set an input's value within the same div
<p>I'm trying to set the value of an input to the value of the list item clicked. Where they both exist within the same div where the class = container</p>

<p>jQuery</p>

<pre><code>$('li').click(function(){

    /* Somehow set the value of the input that is within the same div 
    with class equal container to the data-personguid on this li. */

});
</code></pre>

<p>HTML    </p>

<pre><code>&lt;div class="container"&gt;
    &lt;div&gt;
        &lt;ul&gt;
            &lt;li data-personguid="3" /&gt;
            &lt;/li&gt;
        &lt;/ul&gt;
    &lt;/div&gt;
    &lt;input type="hidden" class="personguid" id="thirdinput" /&gt;
&lt;/div&gt;

&lt;div class="container"&gt;
    &lt;div&gt;
        &lt;ul&gt;
            &lt;li data-personguid="4" /&gt;
            &lt;/li&gt;
        &lt;/ul&gt;
    &lt;/div&gt;
    &lt;input type="hidden" class="personguid" id="fourthinput /&gt;
&lt;/div&gt;
</code></pre>

<p>So if the li with data-personguid = 3 was clicked I would want input with id = thirdinput to have it's value set to 3.</p>

<p>Likewise if the li with data-personguid = 4 was clicked I would want input with id = fourthinput to have it's value set to 4.</p>

<p>So I think what I would be trying to do is find the input of class personguid that is within the same div with class = container as the clicked
list item and set its value.</p>

<p>Currently unsure how to do this.</p>

<p>The jquery needs to be generic so the same code is used for each container block.</p>
