How do I get the datables tbody through .innerHTML?

How do I get the datables tbody through .innerHTML?

tgfcodertgfcoder Posts: 1Questions: 1Answers: 0

Description of problem:

I have a file called mastertable.js that handles the child relation between two datatables. For the child I want to be able to add hyperlinks to the elements of each row so I need to access the html of the tbody. However when I try to do this I can only see the header and thead of the table as well as an empty <tbody></tbody>. Strangely, if I print the table to the console, I can see the whole html including the tbody. How can I get the html of the datatable programmatically?

Answers

  • allanallan Posts: 61,438Questions: 1Answers: 10,051 Site admin
    edited May 2021

    You could do table.table().body().innerHTML using the table().body() method - although I'm not clear on why you would need the raw HTML. Wouldn't you be better with the data?

    Allan

This discussion has been closed.