Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App

Related Articles

jQuery Mobile Popup destroy() Method

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

jQuery Mobile is a JavaScript library built on top of jQuery, it is used to build fast and responsive websites which are accessible on a variety of devices like mobiles, tabs, and desktops, etc.

In this article, we will jQuery Mobile Popup destroy() method to destroy a popup. When we invoke the destroy() method on a popup, the popup functionality is removed from the popup element and it returns to its pre-init state.


$( ".selector" ).popup( "destroy" );

Parameters: This method does not accept any parameter.

CDN Links: To use Popup element, first add jQuery Mobile to your project.

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

Example: In the example below, we will open a popup and invoke the destroy() method after 3000ms.


<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible"
          content="IE=edge" />
    <meta name="viewport" 
          content="width=device-width, initial-scale=1.0" />
    <title>Popup - reposition method</title>
    <link rel="stylesheet"
    <script src=
    <script src=
      function openAndDestroyPopup(){
        $( "#popup1" ).popup( "open", 
                             {positionTo: "#target"} );
        // Destroy the popup 3 seconds after opening
        setTimeout(() => {
          $( "#popup1" ).popup( "destroy");
        }, 3000);
    <div data-role="page">
        <h2 style="color: green">GeeksforGeeks</h2>
        <h3>jQuery Mobile Popup destroy Method</h3>
        <p id="target">
          Popup will open here and will
          destroy after 3 seconds
        <div data-role="popup" id="popup1">
          <p>Welcome to GeeksforGeeks</p>
        <button style="width: 450px;" 
            Open & Destroy Popup


jQuery Mobile Popup destroy() Method


My Personal Notes arrow_drop_up
Last Updated : 04 Jan, 2022
Like Article
Save Article
Similar Reads
Related Tutorials