title: Form using spring, change value of radio button
body: <p>I have bean like this:</p>
  
  <pre><code>class StudentBean
  {
      ...
      private String gender = "Male";
      ...
      // setters and getters here
  }
  </code></pre>
  
  <p>The Spring form is something like this:</p>
  
  <pre><code>&lt;!-- Gender --&gt;
  &lt;form:form action="url" method="POST" modelAttribute="studentBean"&gt;
       &lt;form:radiobutton path="gender" id="male" value="Male" required="required" style="float:left;" checked="checked"/&gt; 
       &lt;form:radiobutton path="gender" id="female" value="Female" required="required" style="float:left;"/&gt;
  ...
  &lt;/form:form&gt;
  </code></pre>
  
  <p>The gender radio button by default is set to <strong>Male</strong>, I want to change it using jQuery.</p>
  
  <p>What I tried so far is:</p>
  
  <p><code>$('.gender[value="'+ beanList[index].myGender +'"]').prop('checked', true);</code></p>
  
  <p>it also the same with</p>
  
  <p><code>$('.gender[value="Female"]').prop('checked', true);</code></p>
  
  <p><strong>But doesn't change the radio button. What am I doing wrong?</strong>             </p>