jquery - <div type="text"> Why specify type? -


i reading jquery ui api datepicker. example code has new me.

<!doctype html> <html> <head>   <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>   <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>   <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>    <script>   $(document).ready(function() {     $("#datepicker").datepicker();   });   </script> </head> <body style="font-size:62.5%;">  <div type="text" id="datepicker"></div>  <<<<<<<<<<<<<<<<<<<<<<<<<"type"???  </body> </html> 

i tried without type="text" , doesn't work anymore. why that?

i'm new html , have never seen assigning type div. searching on internet, couldn't find example div. see type other elements style , script. couldn't find relevant questions @ stackoverflow either.

why need assign type div?

ref: download jquery-ui-1.8.14.custom.zip. it's in "development-bundle\docs\datepicker.html#demo" (the official demo code in offline documentation jquery-ui datepicker)

edit: turned out bug in documentation of jquery datepicker demo code. reported , fixed within few hours question doesn't apply latest version of document.

actually, couldn't find reference fact had use div in documentation, i'm sure of must use input of type text. taken demo:

<script>     $(function() {         $( "#datepicker" ).datepicker();     });     </script>    <div class="demo">  <p>date: <input type="text" id="datepicker"></p>  </div><!-- end demo --> 

moreover: need datepicker if have no input field?


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -