user3424451 user3424451 - 3 months ago 12x
Javascript Question

Dynamically Adding Data Roles (Collapsible data role)

I have a table with a table data-role that i would like to add a collapsible data role to. However i would have to add this dynamically through JQuery Mobile code.


Is there something off with my code? ^


You should be using the jQuery .attr() method to add attributes to an element. Try this: