<?xml version="1.0" encoding="UTF-8" ?>
<dt-api library="Buttons">
	<name>button().text()</name>
	<summary>Get / set the text for the selected button</summary>
	<since>1.0.0</since>

	<type type="function">
		<signature>button().text()</signature>
		<returns type="string">
			The current display string from the button.
		</returns>
		<description>
			Get the display text for the selected button.

			Note that if the button's text option is specified as a function, this method will execute that function and return the result, so a string is always returned.
		</description>
	</type>

	<type type="function">
		<signature>button().text( set )</signature>
		<parameter type="string|function" name="set">
			Text to display in the selected button. This is written to the button as HTML, so HTML tags can be used and will be displayed rendered in the button.

			A function can also be defined, which will be executed whenever Buttons updates the button display text and the result used as the text to be displayed in the button. Please refer to `b-init buttons.buttons.text` for the function signature.
		</parameter>
		<returns type="DataTables.Api">
			DataTables API instance with the selected button in the result set, available for chaining further operations on the buttons.
		</returns>
		<description>
			Set the display text for the selected button
		</description>
	</type>

	<description>
		This method provides the ability to dynamically get and set the display text of one or more buttons. This can be useful if an interaction (such as row selection) changes the behaviour of a button, to let the end user know what that change in behaviour is.
	</description>

	<example title="Get the text for button index 1"><![CDATA[

var table = $('#myTable').DataTable();
var buttonText = table.button( 1 ).text();

]]></example>

	<example title="Use an action to display a button activation counter"><![CDATA[

var table = $('#myTable').DataTable();
var button = table.button( 0 );
var counter = 0;

button
	.text( 'Click counter: 0' )
	.action( function () {
		counter++;
		this.text( 'Click counter: '+counter );
	} );

]]></example>

	<example title="Use a function to display the text"><![CDATA[

var table = $('#myTable').DataTable();

table.button( 0 ).text( function ( dt, button, config ) {
	return dt.i18n( 'buttons.input', 'Input' );
} );

]]></example>
</dt-api>