By clicking on the button in the cell, you need to send the values of the other cells of the same row to the modal form. I found some kind of code, it even outputs something. But what it does and how I get what I need - alas, I don’t know. Tell me what to google to understand what is happening in the script? Or explain what is happening. All the hands in any way will not reach the study of javascript and the task set must be completed.
there is such a markup:
<table id="checked-table" class="table table-bordred table-striped" align="center"> <thead> <tbody> <tr> <td><input type="checkbox" class="checkthis" /></td> <td>0</td> <td>1</td> <td>2</td> <td width="20" align="center"> <p data-placement="top" data-toggle="tooltip" title="Edit"> <button class="btn btn-primary btn-xs" data-title="Edit"> <span class="glyphicon glyphicon-pencil"></span> </button> </p> </td> </tr> </tbody> </thead> </table>
and there is a code:
$('.btn.btn-primary').click(function(){ var tdVals = $(this).parent('td').siblings('td').map(function(i, td){ return $(td).text(); }) console.log(tdVals); });