Toggle select control

Description

The following code shows how to toggle select control.

Example


<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-1.9.1.js'></script>
<script type="text/javascript"
  src="http://code.jquery.com/mobile/1.3.0-beta.1/jquery.mobile-1.3.0-beta.1.js"></script>
<link rel="stylesheet" type="text/css"
  href="http://code.jquery.com/mobile/1.3.0-beta.1/jquery.mobile-1.3.0-beta.1.css">
<style type='text/css'>
.hide {<!-- w w w.  j a va2s . co m-->
  display: none !important;
}
</style>
<script type='text/javascript'>//<![CDATA[ 
$(window).load(function(){
$(document).on('click', '.hide_show', function () {
    $("#searchuniversitycampus").closest('div.ui-select').toggleClass('hide');
});
});//]]>  
</script>
</head>
<body>
  <select name="searchuniversitycampus" id="searchuniversitycampus">
    <option>1</option>
    <option>2</option>
  </select>
  <a href="#" data-role="button" class="hide_show">Hide/Show select</a>
</body>
</html>

Click to view the demo





















Home »
  jQuery Mobile »
    Example »




Button
Button Event
Button Icon
Button Text
Checkbox
Collapsible
Date
Dialog
Event
Footer
Form
Header
Icon
Input
Layout
Listview
Listview Divider
Listview Item
Loader
mobile_settings
Navbar
Page
Page Event
Popup
Radio
Select
Slider
Switch
Textarea
Theme