How to dynamically add data-role="button"
I'm reading in some data from a web service to jquery mobile upon navigating to a new page (data-role="page") and I want to dynamically populate some jquery mobile link buttons, however it appears that the styles are not being applied through the data-role="button".
My code is along the lines of
- var title = DataFromWebService;
- var newsButton = "<a href=\"#\" data-role=\"button\">";
- newsButton+= title + "</a>";
- $(".newslist").append(newsButton);
The button renders as a plain a tag, is there a reason for this? Im assuming dynamically applying a data-role is not the same as dynamically applying a CSS class?
Thanks