if(x.length > 0){
$("#txtHint").append('<div data-role="collapsible-set" id="collapsible-set"></div>');
for(i = 0; i < x.length; i++){
var collapsible = '<div data-role="collapsible" data-collapsed="true" data-theme="none">Content</div>';
$("[data-role=collapsible-set]").append($(collapsible).collapsible()).trigger("create");
}
}
It appends the collapsible divs ok, but they display as if they are in separate sets even though they are not.
This gives a clearer picture of what's happening visually: http://jsfiddle.net/gNJn8/