Bug in .val() on select with jQuery Mobile?
Hi all
I'm having a problem with `.val()` and jQuery Mobile.
This is my code in total. The attempt to set the value of the select as Quietest is not working: it selects Balanced.
- <!DOCTYPE html>
- <html>
- <head>
- <title>Page Title</title>
- <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.css" />
- <script type="text/javascript" src="http://code.jquery.com/jquery-1.5.2.min.js"></script>
- <script type="text/javascript" src="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.js"></script>
- <script type="text/javascript">
- $(document).ready(function() {
- $("#routetype").val('quietest');
- });
- </script>
- </head>
- <body>
- <!-- Start of first page -->
- <div data-role="page" id="foo">
- <div data-role="header">
- <h1>Foo</h1>
- </div><!-- /header -->
- <div data-role="content">
- <select id="routetype" name="routetype">
- <option value="fastest">Fastest</option>
- <option value="balanced">Balanced</option>
- <option value="quietest">Quietest</option>
- </select>
- </div><!-- /content -->
- <div data-role="footer">
- <h4>Page Footer</h4>
- </div><!-- /header -->
- </div><!-- /page -->
- </body>
- </html>
However, if I remove the jQuery mobile script, it works perfectly.
Any thoughts?