title: How can I perform an action after selecting an Option on a Select using Thymeleaf?
body: <p>I'm trying to redirect my page when selecting an Option on a Select using Thymeleaf. My code is written as follows:</p>
  
  <pre><code>&lt;select&gt;
      &lt;option th:each="size : ${pageSizes}" th:text=${size}  th:onclick="'window.location.href = \'' + @{/ingredient(size=${size})} + '\''"&gt;&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>And, after inspecting it on Google Chrome, the HTML created is:</p>
  
  <pre><code>&lt;select&gt;
      &lt;option onclick="window.location.href = '/ingredient?size=5'"&gt;5&lt;/option&gt;
      &lt;option onclick="window.location.href = '/ingredient?size=10'"&gt;10&lt;/option&gt;
      &lt;option onclick="window.location.href = '/ingredient?size=20'"&gt;20&lt;/option&gt;
      &lt;option onclick="window.location.href = '/ingredient?size=25'"&gt;25&lt;/option&gt;
      &lt;option onclick="window.location.href = '/ingredient?size=50'"&gt;50&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>But nothing happens when a select a new Option. What am I doing wrong?</p>