buttons().nodes()

Since: Buttons 1.0.0

Get the button nodes for the selected buttons.
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

buttons().nodes()

Get a DataTables Dom object that contains a reference to the nodes for the selected buttons.

Returns:

Dom:
A DataTables Dom object that contains the nodes for the selected buttons

Examples

Set the background colour for selected buttons:

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

table
	.buttons('.important')
	.nodes()
	.css('background', 'red');

Add a custom click event handler to the selected buttons:

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

table
	.buttons('.data')
	.nodes()
	.on('click', function (e) {
		console.log('Button clicked!');
	});