How to add data attribute to

How to add data attribute to

ZeynalZeynal Posts: 11Questions: 4Answers: 0
edited January 2023 in Free community support

I have this function, can someone help how to add data-order attribute to td element?

Answers

  • kthorngrenkthorngren Posts: 20,144Questions: 26Answers: 4,736

    I'm guessing this is in reference to your other thread. Its difficult understand the code snippet without understanding the solution. For example you are looping through `table.$('.ma_count') elements. What are these elements?

    What is the html response in line 70?

    Maybe something like this will work:

    element.closest('td').setAttribute("data-sort", tooltip_elem.text);
    

    Kevin

Sign In or Register to comment.