How to show/hide a switch?
When activating a switch, I need to put another switch visible
this is my code:
- <script>
-
- $('#page1').on('pagechange', function() {
- $('#youthere').change(function(){
- var slider_value = $(this).val()
- if(slider_value == "on")
- {
- //activate 2° switch
- }
- else
- {
- //desactivate 2° switch
- }
- });
-
- $('#active').change(function(){
-
- });
- });
- </script>
- <div data-role="page" >
- <div data-role="header" data-theme="a" data-position="fixed">
- <h1>Status</h1>
- </div>
- <div data-role="content" >
- <div data-role="fieldcontain">
-
- <label for="slider">Youthere:</label>
-
- <select name="slider" id="youthere" data-role="slider">
- <option value="off">Off</option>
- <option value="on">On</option>
- </select>
-
- <br/>
- <label for="slider">Active:</label>
- <select name="slider" id="active" data-role="slider">
- <option value="off">Off</option>
- <option value="on">On</option>
- </select>
- </div>
-
- </div>
- <div data-role="footer" data-position="fixed">
- <h1>Change Status</h1>
- </div>
- </div>
- </body>
- </html>
I hope I can help. thank you very much