I need to return a value of CNPJ with a mask through Javascript for a text in a td tag of my html code. The value is returned from the default bd of CNPJ as in the code below:
<tr th:each="cliente : ${clientes}" class="cliente">
<td id="#cnpj" th:text="${cliente.cnpj}" class="cnpjTd"></td>
<td id="#razaosocial" th:text="${cliente.razaoSocial}"></td>
For example, the cnpj client returns a value of "11111111111111" and needs to be formatted as "1111111111 / 1111-11."
How can I do this?