e.keyCode does not work

后端 未结 6 575
天命终不由人
天命终不由人 2021-01-23 08:56

I would like to ask you about something that does not work for me ? If you could help me please.

Html:



        
6条回答
  •  执念已碎
    2021-01-23 09:28

    First give function a name .Lets say function keyfinder .Then call it on keyup as onkeyup="function keyfinder(id, event);"

    Then try the following:

    function keyfinder(id, e){
    var eventval = e || window.event;
    var comment = $(".blabla").val();
    // alert(message); WORK
    alert(eventval.keyCode);
    

    }

提交回复
热议问题