draw datepicker dynamically
- <link rel="stylesheet" href="css/jquery-ui-1.9.2/themes/base/jquery-ui.css" />
- <script src="css/jquery-ui-1.9.2/jquery-1.8.3.js"></script>
- <script src="css/jquery-ui-1.9.2/ui/jquery-ui.js"></script>
- <script>
- $(function() {
- $("#datepicker").datepicker({ dateFormat: "yy-mm-dd" }).val()
- });
- </script>
- <script language="javascript">
- function add_new()
- {
- ....
- mydiv.innerHTML = mydiv.innerHTML +"<input type='text' class='datepicker'>";
- }
- </script>
i want the datepicker to be generate dynamically, but somehow with my code above, there only a textbox is generating. it seems unable to call out the class. but when i put "
<input type='text' class='datepicker'> in php, it work fine for me.
anything went wrong? or i shouldn't do in this way?