don ali
don ali

Reputation: 177

jquerymobile button's css not applied

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

Answers (2)

Jon Wells
Jon Wells

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

Rab
Rab

Reputation: 35572

call the .page for the main wrapper where new buttons are added.

$("#content").page();

Upvotes: 1

Related Questions