JSFiddle - React, Tailwind, and code Playground

by Alex Azuero

HTML

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.css" />
<script src="http://code.jquery.com/jquery-1.11.0.js"></script>
<script src="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js"></script>
<!--Datepicker relevant external files-->
<script src="https://rawgithub.com/arschmitz/jquery-mobile-datepicker-wrapper/v0.1.1/jquery.mobile.datepicker.js"></script>
<script src="https://rawgithub.com/jquery/jquery-ui/1.10.4/ui/jquery.ui.datepicker.js"></script>
<link rel="stylesheet" href="https://rawgithub.com/arschmitz/jquery-mobile-datepicker-wrapper/v0.1.1/jquery.mobile.datepicker.css">
 
<input id="date1" data-role="date" type="text">

CSS

input {
    text-align:center !important;
}

JavaScript

$(document).ready(function () {

$("#date1").click(function(){
       //alert(this.value);
       //var d = $('#date1').datepicker('getDate');
       //alert(d)
			//$(this).datepicker("setDate", new Date);
      $('#date1').date("setDate", new Date);      
});
  
$.datepicker.setDefaults({
		dateFormat: 'yy-mm-dd' //yy-mm-dd
});

$( "#date1" ).date({
  prevText: "Earlier"
});


$("#date1").on("change",function(){
     
     var a = $(this).val();
     alert(a);
    });
    
//$("#date1").change(function () {
   // alert($(this).val());
//});


});//end of ready function