title: How to set radio button checked by default in Thymeleaf
body: <p>I have group of 3 radio buttons. The user can choose only 1 of 3. I want to set a radio button chosen as default. I've tried this code but the <strong>checked</strong> attribute seems to be ignored.</p>
  
  <pre><code>    &lt;div&gt;
          &lt;input type="radio" th:field="*{genre}" th:value="Strategy" checked="true"&gt;
          &lt;label th:for="${#ids.prev('genre')}"&gt;Strategy&lt;/label&gt;
      &lt;/div&gt;
      &lt;div&gt;
          &lt;input type="radio" th:field="*{genre}" th:value="RPG"&gt;
          &lt;label th:for="${#ids.prev('genre')}"&gt;RPG&lt;/label&gt;
      &lt;/div&gt;
      &lt;div&gt;
          &lt;input type="radio" th:field="*{genre}" th:value="Stealth"&gt;
          &lt;label th:for="${#ids.prev('genre')}"&gt;Stealth&lt;/label&gt;
      &lt;/div&gt;
  </code></pre>
  
  <hr>
  
  <pre><code>public class Game
  {
      private String genre;
      //Constructor
      //Getter &amp; Setter
  }
  </code></pre>