jQuery Datepicker close datepicker after selected date

后端 未结 5 1980
难免孤独
难免孤独 2020-12-24 01:34

HTML:

5条回答
  •  北海茫月
    2020-12-24 02:22

    Answer above did not work for me on Chrome. The change event was been fired after I clicked out of the field somewhere, which did not help because the datepicker window is also closed too when you click out of the field.

    I did use this code and it worked pretty well. You can place it after calling .datepicker();

    HTML

    
    

    JavaScript

    $(".datepicker-input").each(function() {
        $(this).datepicker();
    });
    
    $(".datepicker-input").click(function() {
        $(".datepicker-days .day").click(function() {
            $('.datepicker').hide();
        });
    });
    

提交回复
热议问题