simplest way to create select menu
http://jsbin.com/apotot/3/edit
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset=utf-8 />
- <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0.min.css" />
- <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
- <script src="http://code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0.min.js"></script>
-
- <title>JS Bin</title>
- </head>
- <body>
-
- </body>
-
- <script>
- $(document).ready(function (){
- var s = $('<select/>');
- var o = [1, 2, 3];
- for (var i in o) {
- s.append($('<option/>').html(o[i]));
- }
- $('body').append(s);
- });
- </script>
- </html>
what is wrong with this piece?