I want to add class="cpf_cnpj"
to a input
with id input-custom-field2
when loading the page, follow the html and javascript that I tried to use but to no avail:
<input type="text" name="custom_field[account][2]" value="" placeholder="CPF" id="input-custom-field2" class="form-control">
<script>
$(document).ready(function() {
document.getElementById("input-custom-field2").addClass('cpf_cnpj');
});
</script>