Reputation: 177
I'm trying to add a delete button to a custom div. However when the page is loaded, the jquery mobile button does not take the format of jquery and displays it like a hyperlink.
var currDelButton = $("<a>").attr("href","#").attr("data-role","button").attr("data-icon","delete").attr("data-iconpos","left").text("حذف");
anyone has an idea about this issue?
Best Regards Ali
Upvotes: 0
Views: 108
Reputation: 4259
If you are adding the button after the page is loaded then you need to refresh the element for example $("#mybutton").button();
should work.
here is a working example with the code you provided: http://jsfiddle.net/ashanova/RQVd8/1/
Upvotes: 1
Reputation: 35572
call the .page
for the main wrapper where new buttons are added.
$("#content").page();
Upvotes: 1