title: Do an action when click a button in datatable
body: <p>sorry about my English, is not very good. I'll try to explain my problem. I've a table with some button at the end of each row, and I need a diferent action when click them. Table is made with dataTables and this is all I have.</p>
  
  <pre><code>    $(document).ready(function() {
      var table = $('#dataart').DataTable( {
  
          "columnDefs": [ {
              "targets": -1,
              "data": null,
              "defaultContent": '&lt;button id="ver" class="btn btn-sm btn-primary"&gt;&lt;span class="glyphicon glyphicon-eye-open"&gt;&lt;/span&gt;&lt;/button&gt;&amp;nbsp;' +
                                '&lt;button id="editar" class="btn btn-sm btn-warning"&gt;&lt;span class="glyphicon glyphicon-edit"&gt;&lt;/span&gt;&lt;/button&gt;&amp;nbsp;' +
                                '&lt;button id="eliminar" class="btn btn-sm btn-danger"&gt;&lt;span class="glyphicon glyphicon-trash"&gt;&lt;/span&gt;&lt;/button&gt;'
          } ]
      } );
  
      $('#dataart tbody').on( 'click', 'button', function () {
          var data = table.row( $(this).parents('tr') ).data();
          **if (button id=ver click) do something like this document.getElementById("x").value= data[1] or call a function.
          if (button id=editar click) do a second function.
          if (button id=eliminar click) do other function.**
      } );
  
  } )
  </code></pre>
  
  <p>And that's all, maybe is very simple to do, but it's first time I use this plugin.</p>
  
  <p>Thank you very much.</p>