Get the value of bootstrap Datetimepicker in JavaScript

前端 未结 8 1990
心在旅途
心在旅途 2020-11-30 05:49

I need to get the value of Datetimepicker in my JavaScript function. I have made something like this, but it doesn\'t work:

$(\"#date\").click( function(){
         


        
8条回答
  •  萌比男神i
    2020-11-30 06:28

    This is working for me using this Bootsrap Datetimepiker, it returns the value as it is shown in the datepicker input, e.g. 2019-04-11

    $('#myDateTimePicker').on('click,focusout', function (){
        var myDate = $("#myDateTimePicker").val();
        //console.log(myDate);
        //alert(myDate);
    });
    

提交回复
热议问题