I have one button but I need two buttons and perform some MySql when they are clicked to get data from the underlying database.
How can I perform an event using these two buttons?
$(document).ready(function () {
var table= $('#example').dataTable( {
"ajax": "..//wp-content/plugins/jobify/Admin/data.txt",
"columnDefs": [ {
"targets": -1,
"data": null,
"defaultContent": "<button>View Posted Jobs</button>"
} ]
} );
$('#example tbody').on( 'click', 'button', function () {
//var data = table.row( $(this).parents('tr') ).data();
} );
} );
Just assign a class to each button and attach an event handler to each class.