title: jQuery bind/change to Drop Down Form
body: <p>I had a longer post describing what I am trying to do, but I don't think that is necessary so I'm making this simple.  I'm working on getting Zurb Foundation to work with Datatables.  It's been pretty easy except for the drop down menu.  I've had a bit of a tough time getting this working as a js novice.  Here is the general syntax of a Foundation drop down.</p>
  
  <pre><code>&lt;label for="customDropdown"&gt;Dropdown Label&lt;/label&gt;
  &lt;select style="display:none;" id="customDropdown"&gt;
    &lt;option select="selected"&gt;This is a dropdown&lt;/option&gt;
    &lt;option&gt;This is another option&lt;/option&gt;
    &lt;option&gt;Look, a third option&lt;/option&gt;
  &lt;/select&gt;
  &lt;div class="custom dropdown"&gt;
    &lt;a href="#" class="current"&gt;This is a dropdown&lt;/a&gt;
    &lt;a href="#" class="selector"&gt;&lt;/a&gt;
    &lt;ul&gt;
      &lt;li class="selected"&gt;This is a dropdown&lt;/li&gt;
      &lt;li&gt;This is another option&lt;/li&gt;
      &lt;li&gt;Look, a third option&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Where I've run into problems is my event listener to update the table length fires on a click on the UL, so the table length is updated with the previously selected length.  Because the Foundation JS is the one updating the UL LI, every attempt to detect the change doesn't work because my code is firing before Foundation applies the class to the LI.  </p>
  
  <p>So to update the table it seems clear I have to detect the change of either the option value</p>
  
  <pre><code>$('div#example_length form select').val()
  </code></pre>
  
  <p>or in the LI</p>
  
  <pre><code>$('div.custom ul li.selected').text()
  </code></pre>
  
  <p>I tried chaining the .change() function onto the above to detect the change in value but it's giving me an error.  I'm pretty lost here.  I've spent quite a bit of time trying to work this out.</p>
  
  <p>Edit:  Just to be clear, what I'm trying to do is get the correct value for the drop down when it's selected.  I get a value now but it's the one previously selected not the one just selected.   Because of the way that Foundation works I'm having a hard time doing that with my green belt jQuery skills.</p>
  
  <p>Thanks.</p>