Skip to content
Related Articles

Related Articles

jQuery UI Accordion destroy() Method

Improve Article
Save Article
Like Article
  • Last Updated : 18 Jan, 2021

To destroy an accordion in jQuery UI we will be using destroy() method which is discussed below:

jQuery UI destroy() method is used to remove the complete functionality of the accordion. It returns the accordion element completely to its initial state.


$( ".selector" ).button( "destroy" )

Parameters: This method does not accept any parameters.

Return values: This method simply returns the button to its pre-initial state.

Approach: First, add jQuery Mobile scripts needed for your project.

<script src=””> </script>
<script src=””></script>
<link href=”” rel=”stylesheet” type=”text/css” />


<!DOCTYPE html> 
    <meta charset="utf-8"
    <meta name="viewport" content
        "width=device-width, initial-scale=1"
    <script src
    <script src
    <link href
        rel="stylesheet" type="text/css" /> 
        .height { 
            height: 10px; 
        $(function () { 
            $( "#gfg" ).accordion();
            $( "#gfg" ).accordion( "destroy" );
         #gfg{font-size: 17px;}
    <h1 style="color:green">GeeksforGeeks</h1
    <b>jQueryUI | destroy Accordion</b
    <div id="gfg">


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!