title: Jquery assign value to input
body: <p>I have the following input field </p>
  
  <p><code>&lt;input type="text" name="location[state_id]"  id="location[state_id]" value=""  &gt;</code></p>
  
  <p>and i am trying to assign there a value with the following jquery</p>
  
  <pre><code>$("#location\\[state_id\\]").val("5");
  </code></pre>
  
  <p>but it does not working! It works only if the name of both is only location.</p>
  
  <p>Thanks</p>