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