Parse thymeleaf variable onclick

<button th:onclick="'javascript:upload(' + ${gallery} + ')'"></button>
Shy Sheep