Getting id from UL when clicking on the button
<p>How to get <code>OptionGroupID</code> and <code>optionName</code> from <code>ul</code> when you click on the Add button?</p>

<p>For example:</p>

<pre><code>&lt;ul id="formAddOption_4" class="formStyle"&gt;
   &lt;li&gt; 
     &lt;input id="OptionGroupID" type="hidden" value="4"&gt; 
     &lt;div style="font-size:10px;"&gt; Option Name: &lt;/div&gt; 
     &lt;input id="optionName" type="text"&gt;
  &lt;/li&gt;
  &lt;li&gt;
   &lt;input type="button" class="buttonAddOption" value="Add Option"&gt; 
  &lt;/li&gt;
&lt;/ul&gt;
&lt;ul id="formAddOption_5" class="formStyle"&gt;
   &lt;li&gt; 
     &lt;input id="OptionGroupID" type="hidden" value="5"&gt; 
     &lt;div style="font-size:10px;"&gt; Option Name: &lt;/div&gt; 
     &lt;input id="optionName" type="text"&gt;
  &lt;/li&gt;
  &lt;li&gt;
   &lt;input type="button" class="buttonAddOption" value="Add Option"&gt; 
  &lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>I have tried this but it dont work:</p>

<pre><code>$(".buttonAddOption").click(function() {
  var OptionForm = $(this).closest("ul");
  //Get Group ID
  alert( OptionForm.$("#OptionGroupID").val() );
});
</code></pre>
