get value from a function and put in a variable

0

Personal how can I pass the attributes below into a variable?

<script>
$(document).on("click", "#btnInfoMaq", function () {
    var info = $(this).attr('data-id');
    var str = info.split('|');
    var serie_maquina = str[0];
    var grupo_maquina = str[1];
    $(".modal-body #serie_maquina").val(serie_maquina);
    $(".modal-body #grupo_maquina").val(grupo_maquina);
});

So ... in the script above I get the data through a button!

<?php echo "<button class='btn btn-info' data-toggle='modal' data-target='#modalInfoMaq' id='btnInfoMaq' data-id='$serie_maquina|$grupo_maquina'> Informação</button>"?>

I am trying to find a way to do this, but I do not know how to do it. ! to be able to perform a query.

How can I get this information and put it in a variable $?

    
asked by anonymous 11.04.2018 / 19:41

0 answers