jquery datepicker on esc key event

前端 未结 1 1658
夕颜
夕颜 2021-01-24 06:22

I\'m trying to put a date value in the input box for the date picker when the user click on the key ESC (e.keyCode == 27) once he as open the datepicker.

<
相关标签:
1条回答
  • 2021-01-24 06:33
    $("#input").keyup(function(e) {
        if (e.keyCode == 27) {
            $("#input").val("01/01/2011");
        }
    });
    

    See it in action here: http://jsfiddle.net/nayish/SYwpy/46/

    0 讨论(0)
提交回复
热议问题