0
I need to hit the button when I click. I did it in jquery in a generic way by passing the parameter of a given button to execute the script to it.
<button id="buttonprofissional" type="button" class="btn btn-warning" value="profissional">Não tenho endereço profissional </button>
<button id="buttoncomplementar" type="button" class="btn btn-warning" value="complementar">Não tenho endereço complementar </button>
<script>
$(document).ready(function($endereco){
    $("button" + $endereco).click(function(){
        $("pais_"+$endereco).removeAttr('required');
        $("pais_"+$endereco).hide();
        $("uf_"+$endereco).removeAttr('required');
        $("uf_"+$endereco).hide();
        $("municipio_"+$endereco).removeAttr('required');
        $("municipio_"+$endereco).hide();
        $("bairro_"+$endereco).removeAttr('required');
        $("bairro_"+$endereco).hide();
        $("tipo_logradouro_"+$endereco).removeAttr('required');
        $("tipo_logradouro_"+$endereco).hide();
        $("titulo_patente_"+$endereco).removeAttr('required');
        $("titulo_patente_"+$endereco).hide();
        $("preposicao_"+$endereco).removeAttr('required');
        $("preposicao_"+$endereco).hide();
        $("logradouro_"+$endereco).removeAttr('required');
        $("logradouro_"+$endereco).hide();
        $("numero_"+$endereco).removeAttr('required');
        $("numero_"+$endereco).hide();
        $("complemento_"+$endereco).removeAttr('required');
        $("complemento_"+$endereco).hide();
        $("origem_"+$endereco).removeAttr('required');
        $("origem_"+$endereco).hide();
        $("email_"+$endereco).removeAttr('required');
        $("email_"+$endereco).hide();
        $("telefone_"+$endereco).removeAttr('required');
        $("telefone_"+$endereco).hide();
        $("celular_"+$endereco).removeAttr('required');
        $("celular_"+$endereco).hide();
    });
});
where $address comes from ?
– Felipe Duarte
What is
$endereco = this.value?– Sergio