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

Related Articles

How to make a vertical controlgroup using jQuery Mobile ?

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

jQuery Mobile is a web based technology used to make responsive content that can be accessed on all smartphones, tablets and desktops. In this article, we will be making a vertical controlgroups using jQuery Mobile.

Approach:

  • First, add jQuery Mobile scripts needed for your project.

    <link rel=”stylesheet” href=”http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css” />
    <script src=”http://code.jquery.com/jquery-1.11.1.min.js”></script>
    <script src=”http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js”></script>

Example 1: In this example, we will be using Button for grouping buttons vertically.

HTML




<!DOCTYPE html>
<html>
  
<head>
    <link rel="stylesheet" href=
  
    <script src=
    </script>
  
    <script src=
    </script>
</head>
  
<body>
    <center>
        <h1>GeeksforGeeks</h1>
  
        <h4>
            Vertical controlgroup button 
            using jQuery Mobile
        </h4>
    </center>
  
    <div data-role="controlgroup">
        <button data-role="button">No icon</button>
        <button data-role="button" data-icon="delete" 
            data-iconpos="left" id="gfg">
            Left
        </button>
          
        <button data-role="button" data-icon="delete" 
            data-iconpos="right" id="gfg">
            right
        </button>
          
        <button data-role="button" data-icon="delete"
            data-iconpos="top" id="gfg">
            top
        </button>
          
        <button data-role="button" data-icon="delete"
            data-iconpos="bottom" id="gfg">
            bottom
        </button>
          
        <button data-role="button" data-icon="delete"
            data-iconpos="notext" id="gfg">
            icon only
        </button>
    </div>
</body>
  
</html>

Output:

Example 2: In this example, we will be using Anchor for grouping buttons vertically.

HTML




<!DOCTYPE html>
<html>
  
<head>
    <link rel="stylesheet" href=
  
    <script src=
    </script>
  
    <script src=
    </script>
</head>
  
<body>
    <center>
        <h1>GeeksforGeeks</h1>
  
        <h4>
            Vertical controlgroup anchor 
            using jQuery Mobile
        </h4>
    </center>
  
    <div data-role="controlgroup">
        <a href="https://www.geeksforgeeks.org/" 
            data-role="button">
            No icon
        </a>
          
        <a href="https://www.geeksforgeeks.org/" 
            data-role="button" data-icon="delete" 
            data-iconpos="left">
            Left
        </a>
          
        <a href="https://www.geeksforgeeks.org/" 
            data-role="button" data-icon="delete" 
            data-iconpos="right">
            right
        </a>
          
        <a href="https://www.geeksforgeeks.org/" 
            data-role="button" data-icon="delete" 
            data-iconpos="top">
            top
        </a>
          
        <a href="https://www.geeksforgeeks.org/" 
            data-role="button" data-icon="delete" 
            data-iconpos="bottom">
            bottom
        </a>
          
        <a href="https://www.geeksforgeeks.org/" 
            data-role="button" data-icon="delete" 
            data-iconpos="notext">
            icon only
        </a>
    </div>
</body>
  
</html>

Output:


My Personal Notes arrow_drop_up
Last Updated : 10 Dec, 2020
Like Article
Save Article
Similar Reads
Related Tutorials