Hormis Lona
Hormis Lona

Reputation: 523

How can I change text of button inside data table

How can I change text of button inside data tables default content.I want to change the text when that button is clicked. ie, view to viewed .How can I do that?

Upvotes: 2

Views: 2039

Answers (1)

Manwal
Manwal

Reputation: 23816

This can be done by giving save class to each button and add click listener:

$('.view-btn').click(function(){
    $(this).text("Viewed");
    /*
         Place your custom code here like Ajax request
    */
});

DEMO

Upvotes: 1

Related Questions