0
I need to return a CNPJ value with a mask via Javascript to a text in a td tag of my html code. The value is returned from the standard CNPJ formatted bd 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 "11111111111111" and accurate value that is formatted as "11.111.111/1111-11".
How can I do that?
Related: https://answall.com/questions/77505/formatar-mascara-para-cnpj , https://answall.com/questions/177760/como-se-faz-máscara-para-display-de-fone-cnpj-cpf-etc-nolaravel, https://answall.com/questions/94956/máscara-para-cpf-e-cnpj-no-mesmo-campo
– Caique Romero