make a variable read on thymleaf code example
Example 1: how to use thymeleaf in html
// Add xmlns:th="http://www.thymeleaf.org" into the html opening tag like
<html lang="en" xmlns:th="http://www.thymeleaf.org">
Example 2: how to create a variable in thymeleaf
You can use local variables. Declare an HTML element with a th:with attribute. For example <div th:with="someVariable=${someValue}"