title: Correct way of accessing the array id of textbox using JQuery
body: <p>Can anyone help me, what is the correct syntax if the id or name of the textbox is an array?</p>
  
  <pre><code>&lt;input type="text" name="txt" id="txt" value="1" /&gt;
  &lt;input type="text" name="txt[0]" id="txt[0]" value="2" /&gt;
  
  &lt;script&gt;
      // Msg: 1
      alert($('#txt').val());
  
      // Msg: Undefined
      alert($('#txt[0]').val());
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Thank you inadvance</p>