To contextualize:
I have a "log" object, which was declared in an HTML page through thymeleaf:
<html xmlns:th="http://www.thymeleaf.org" th:include="layout :: page">
...
<form class="form-inline" action="#" th:action="@{'log/'}" th:object="${log}" method="post">
In some part of the code the content of this object, which is nothing more than a string of text, is displayed:
<p th:utext="${log.content}">Log content</p>
Content:
1. a
2. b
3. c
...
My question:
Is it possible to put this content inside a variable, and then use it inside an .js?
Something like:
HTML:
<input type="hidden" th:value="${log.content}" >
Js:
var aux = $('input');
document.getElementById('content').innerHTML = aux.value;
My goal is to handle this " log.content
" out of HTML, is it possible?