Reputation: 89
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.
$('#tabledataroleid').data('role','collapsible-set');
$('#tabledataroleid').data('role','collapsible');
Is there something off with my code? ^
Upvotes: 1
Views: 67
Reputation: 251
You should be using the jQuery .attr() method to add attributes to an element. Try this:
$('#tabledataroleid').attr('role','collapsible-set');
$('#tabledataroleid').attr('role','collapsible');
Upvotes: 1