jQuery get value of input datetime-local -


i need value input datetime-local, variable empty, whereas ok text inputs. here code:

<script> var datetimeval = $("#datetime").val(); var textval = $("#text").val(); </script> <input id='text' type='text' /> <input id='datetime' type='datetime-local' /> 

could tell me please, how fix it?

try this

<input id='text' type='text' value="test"/> <input id='datetime' type='datetime-local' /> <script> var datetimeval = $("#datetime").val(); var textval = $("#text").val(); alert(textval);  alert(datetimeval); </script> 

demo: fiddle

note: gave default value text input textbox


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -