Change button label in Table

Change button label in Table

Hildeb67Hildeb67 Posts: 29Questions: 11Answers: 0

Is it possible to change the switch label of a button
I have the following button in a row that should have a different text when clicked

columns: [  
{
        data: null,
        defaultContent: '<button>MZF</button>',
        targets: -1
            }
        table.on('click', 'button', function (e) {

Here I want to change the text of the button

      ???? defaultContent = "Fertig";


            });

is this possible ?

greetings chris

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 60,903Questions: 1Answers: 9,927 Site admin
    Answer ✓

    Hi Chris,

    this.innerHTML = "Fertig";
    

    should do the job.

    In the event handler there, the scope of this will be the button which is how that works.

    Allan

  • Hildeb67Hildeb67 Posts: 29Questions: 11Answers: 0

    Thank you very much for the tip, it worked

Sign In or Register to comment.