Horizontal controlgroup Selectmenu



Description

Set the select menu horizontally by including the data-type = "horizontal" to the fieldset.

Example

Following example demonstrates the use of horizontal controlgroup selectmenu in the jQuery Mobile.

<!DOCTYPE html>
<html>
   <head>
      <meta name = "viewport" content = "width = device-width, initial-scale = 1">
      <link rel = "stylesheet" href = "https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
      <script src = "https://code.jquery.com/jquery-1.11.3.min.js"></script>
      <script src = "https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
   </head>
   
   <body>
      <h2>Horizontal Controlgroup Example</h2>
      <fieldset data-role = "controlgroup" data-type = "horizontal">
         
         <label for = "select">Select</label>
         <select id = "select" data-native-menu = "false">
            <option value = "#">Maharastra</option>
            <option value = "#">Thane</option>
            <option value = "#">Mumbai</option>
            <option value = "#">Pune</option>
         </select>

         <label for = "select1">Select</label>
         <select id = "select1" data-native-menu = "false">
            <option value = "#">Karnataka</option>
            <option value = "#">Hubli</option>
            <option value = "#">Bangalore</option>
            <option value = "#">Belgaum</option>
         </select>

         <label for = "select2">Select</label>
         <select id = "select2" data-native-menu = "false">
            <option value = "#">Tamil Nadu</option>
            <option value = "#">Madurai</option>
            <option value = "#">Chennai</option>
            <option value = "#">Ooty</option>
         </select>
         
      </fieldset>
   </body>
</html>

Output

Let's carry out the following steps to see how the above code works −

  • Save the above html code as selectmenu_custom_horizontal_controlgroup.html file in your server root folder.

  • Open this HTML file as http://localhost/selectmenu_custom_horizontal_controlgroup.html and the following output will be displayed.

jquery_mobile_widgets.htm
Advertisements