To add a dynamic paragraph in dynamic div


I had created a dynamic div and paragraph in dialog box to show confirmation while submitting the form. How to append the dynamic paragraph inside the dynamic div, Please help me on this.

Thanks in Advance.

<!DOCTYPE html>

<html lang="en">
        <meta charset="utf-8" />
        <title>Jquery Confirm Dialog</title>
        <script src=""></script>
        <link rel="stylesheet" href="" />
        <script src="JQUERY/jquery-ui.js"></script>
        <style type="text/css">
                .ui-dialog .ui-dialog-titlebar, .ui-dialog .ui-dialog-buttonpane { font-size: 0.8em; }
        <script type="text/javascript">
            $(document).ready(function ()
                $("#ShowDivPopup").click(function ()
                    var DynamicDiv = $('<div id="dynamicPopupDiv" style="width: 340px;height: 380px;background-color:#fff;display: none"></div>');
                    var Message = $('<p>Are you Sure</p>');

                        modal: true,
                        height: 180,
                        width: 320,
                        title: 'Info',
                        closeOnEscape: false,
                        resizable: false,
                        draggable: true,
                        buttons: {
                            "Ok": function ()
                                alert("Submit form ");

                            "Cancel": function ()

        <form id="myForm" method="post" action="return welcome()">
            <div id="ConFirmDiv" style="width: 340px;height: 380px;background-color:#fff;display: none">
                <span>Are You Sure Want to Submit</span>
            <input type="button" id="ShowDivPopup" value="Show Popup" />

You want to refer to the DynamicDiv object not the literal:




You called your ID dynamicPopDiv, therefore when you reference $("#DynamicDiv") it doesn't return the jQuery object.