Reputation: 11
Can somebody help me with this
How can I append an element and preserve its style ?
I have tried $(....).trigger(create);
Thanks
Upvotes: 1
Views: 483
Reputation: 4947
Trigger the refresh
event of the listview
, just after appending your object, by using:
$("ul").listview("refresh");
You should then have the following JS code:
$(document).ready(function(){
$("#btn1").click(function(){
$("ul").append("<li><a href="+"#page2"+">Page Two</a></li>");
// Trigger refresh event
$("ul").listview("refresh");
});
});
Upvotes: 2