vendredi 16 octobre 2015

How to get the position of the checked checkbox in a table

I have a table with bunch of checkboxes in each row. How can I find position of the checked box e.g. 1A or 1B when both or one of the checkboxes is checked in first row.

<table id="mytable">
    <tr>
        <td> </td>
        <td align="center"> A </td>
        <td align="center"> B </td>
    </tr>
    <tr>
        <td> 1 </td>
        <td><input type="checkbox" /></td>
        <td><input type="checkbox" /></td>
    </tr>
    <tr>
        <td> 2</td>
        <td><input type="checkbox" /></td>
        <td><input type="checkbox" /></td>
    </tr>
    </table>
    <tr> <button id="save">Click</button> </tr>

Aucun commentaire:

Enregistrer un commentaire