Skip to main content
Initializing Date & Time
Levi Kovacs avatar
Written by Levi Kovacs
Updated over 7 years ago

Usually you want to create the Date & Time picker on an input. In this example we are going to do just that, however you can choose to initialize it on any HTML element. What the initialization does is that it binds the control to the input which means tapping or clicking it will open the Mobiscroll control and pass on its value. 

A two-way binding is crated, so that the selected value gets pushed back to the input on submit.

HTML

<input type="text" id="date" placeholder="Please select..." />


JS

<script>
    mobiscroll.date("#date");
</script>

What's next?

Did this answer your question?