实例 jQuery Mobile 切换开关

x
 
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css">
<script src="https://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script src="https://libs.baidu.com/jquerymobile/1.3.0/jquery.mobile-1.3.0.min.js"></script>
</head>
<body>
<div data-role="page">
  <div data-role="content">
    <form method="post" action="/example/html/html_form.aspx">
      <div data-role="fieldcontain">
        <label for="switch">切换开关:</label>
        <select name="switch" id="switch" data-role="slider">
          <option value="on">On
          <option value="off">Off
        </select>
      </div>
      <input type="submit" data-inline="true" value="提交">
    </form>
  </div>
</div>
</body>
</html>
                    

输出结果