Open In App
Related Articles

jQuery Mobile Dialog create Event

Like Article
Save Article
Report issue

jQuery Mobile is a web-based technology designed to make responsive websites and apps that are accessible on all smartphone, tablet, and desktop devices. DialogWidget is used as a pop-up & can be used on any page to convert it into a modal dialog.

In this article, we are going to learn the jQuery Mobile Dialog create Event. The create event is triggered when the dialog widget is created. The callback function of the dialog is called when the dialog is created.


The callback function for the create event is given below:

    create: function( event, ui ) {}

Parameter values:

  • event: This event will be triggered when the dialog is created.
  • ui: It specifies the empty object, although, it is included for consistency with other widgets.

For binding the event listener to the dialogcreate event:

$("Selector").on("dialogcreate", function(event, ui ) {});

CDN Links: The following are CDN Links for the jQuery Mobile project.

<link rel=”stylesheet” href=”” />
<script src=””></script>
<script src=””></script>

Example: In the following example, whenever the page is loaded, the dialog is created and an alert message is shown.


<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" 
          content="IE=edge" />
    <meta name="viewport" 
                   initial-scale=1.0" />
    <link rel="stylesheet" 
    <script src=
    <script src=
    <div data-role="page" id="gfgpage">
        <div data-role="header">
            <h1 style="color: green;">
        <div data-role="main" class="ui-content">
            <h3>jQuery Mobile Dialog create Event</h3>
                <a href="#gfgDialog" data-rel="dialog">
                    GeeksforGeeks dialog
    <div data-role="page" id="gfgDialog">
        <div data-role="header">
        <div role="main" class="ui-content">
<p>Programming Tutorials Website</p>
                <li>Data Structures</li>
                <li>Web Development</li>
            create: function(event, ui) {
                alert("Welcome to GeeksforGeeks")




Last Updated : 26 Jan, 2022
Like Article
Save Article
Share your thoughts in the comments
Similar Reads