JSFiddle - React, Tailwind, and code Playground
by Omar X
HTML
<div data-role="page" id="page">
<a href="#" data-role="button" id="create">Create a popup</a>
</div>
JavaScript
$('#create').on('click', function () {
//create a div for the popup
var $popUp = $("<div/>").popup({
dismissible: false,
theme: "a",
overlyaTheme: "a",
transition: "pop"
}).on("popupafterclose", function () {
//remove the popup when closing
$(this).remove();
});
//create a title for the popup
$("<ul id='test' data-role='listview'/>").trigger("refresh").appendTo($popUp);
$popUp.popup('open');
//$popUp.popup('open');
});
$(document).on('popupafteropen', function () {
$('ul#test').append('<p>hello</p>');
$('ul#test').listview('refresh');
});