title: How do I get the value of a form element that has brackets in the ID?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1239095/find-dom-element-by-id-when-id-contains-square-brackets">Find DOM element by ID when ID contains square brackets?</a>  </p>
  </blockquote>
  
  
  
  <p>I am unable to get the value of form elements that are somewhat crazy. For example I have a HTML form element that "has" to have the name of "<code>data[User][notify_one_day_out]</code>". The problem is that I am unable to get the value of the form element.  </p>
  
  <pre><code>&lt;label for="data[User][notify_one_day_out]"&gt;One day away:&lt;/label&gt;
  &lt;select name="slider" id="data[User][notify_one_day_out]" data-role="slider"&gt;
      &lt;option value="0"&gt;OFF&lt;/option&gt;
      &lt;option value="1" selected="selected"&gt;ON&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>However </p>
  
  <pre><code>alert( $("#data[User][notify_one_day_out]").val());
  </code></pre>
  
  <p>comes out as undefined. Any help?</p>