Skip to content
Advertisement

Change button text depend on click of another button

I have button in datatable which has dropdown items. I want to change text of the button depend on click of dropdown item. For example : if user clicks on ‘Toggle start date’, the text of main button should be changed from ‘Table control’ to ‘Toggle start date’.

JavaScript
JavaScript

Advertisement

Answer

You can simple use dt.buttons(0).text('Text you need') like:

JavaScript
JavaScript

Reference:

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement