jQuery event when HTML5 Datalist option is clicked

前端 未结 3 1049
醉话见心
醉话见心 2020-12-15 18:50

What I have now:

So i have this HTML5 Datalist with a bunch of options in it, and I have 2 events firing. One when the user types out something that

3条回答
  •  情书的邮戳
    2020-12-15 19:44

    Use the input event instead of the other events. It's actually designed to cover what you want:

    $("#name").bind('input', function () {
        window.checkModelData(this);
    });
    

    I made a jsfiddle for you to try it out.

提交回复
热议问题