dimanche 28 octobre 2018

Get column number of checkbox on change

I'm trying to get the table column number of a checkbox when selected

Below is the code I have been trying, but it returns 0. How would be best to do this?

 $(document).on('change', '.select_all_checkbox', function() {
        var columnNo = $(this).index();
        alert(columnNo);
    });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>



Aucun commentaire:

Enregistrer un commentaire