button().node()

Since: Buttons 1.0.0

Get the button node for the selected button.
Please note - this property requires the Buttons extension for DataTables.

Description

It can often be useful to have access to the DOM node of a button so you can manipulate it. This method provides exactly that option.

Upgrade note: Please be aware that prior to Buttons 4, this method would return a jQuery object, but due to jQuery being removed as a dependency, it will now return a DataTables Dom instance.

Type

button().node()

Get a DataTables Dom object that contains a reference to the node for the selected button.

Returns:

Dom:
A DataTables Dom object that contains the node of the selected button

Examples

Set the background colour for button index 0:

var table = new DataTable('#myTable');

table
	.button(0)
	.node()
	.css('background', 'blue');

Add a custom click event handler to a selected button:

var table = new DataTable('#myTable');

table
	.button('copy:name')
	.node()
	.on('click', function (e) {
		console.log('Copy button clicked!');
	});