VOOZH about

URL: https://www.geeksforgeeks.org/jquery/jquery-mobile-collapsible-heading-option/

⇱ jQuery Mobile Collapsible heading Option - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

jQuery Mobile Collapsible heading Option

Last Updated : 23 Jul, 2025

jQuery Mobile is a web-based technology and great building UI interfaces for the webpages that can be used to make responsive content for websites that can be accessed on all types of smartphones, tablets, and desktops.  

In this article, we will be using the jQuery Mobile Collapsible heading option to get or set the header for the collapsible. The header will be the first immediate child element in the collapsible container that matches the provided selector.

Syntax: The below syntax is used to initialize the collapsible with the heading option.

$( ".selector" ).collapsible({
 heading: ".mycollapsibleheading"
});
  • Get the default option:

    var heading = $( ".selector" )
     .collapsible( "option", "heading" );
  •  
  • Set the default option:

    $( ".selector" ).collapsible( 
     "option", "heading", ".mycollapsibleheading" );

CDN Links: Add the following jQuery Mobile scripts that you will need in your project.

<link rel="stylesheet" href="//code.jquery.com/mobile/1.5.0-alpha.1/jquery.mobile-1.5.0-alpha.1.min.css"> <script src="//code.jquery.com/jquery-3.2.1.min.js"></script> <script src="//code.jquery.com/mobile/1.5.0-alpha.1/jquery.mobile-1.5.0-alpha.1.min.js"></script>

Example: This example demonstrates the jQuery Mobile Collapsible heading option.

Output:

👁 jQuery Mobile Collapsible heading Option
jQuery Mobile Popup tolerance option

Reference: https://api.jquerymobile.com/collapsible/#option-heading

Comment

Explore