문제

I have a problem

My php file

<div id='1'><input type='text' onkeyup="comment('<?php echo $_SESSION["id"] ?>', e)"> 
</div>

My javascript file

function comment(id, e){alert(id); // WORK
alert(e.keyCode); //DOES NOT WORK}
도움이 되었습니까?

해결책

Change your code to :

onkeyup="comment(event,'your string')"> 

function comment(e,id) {
  var comment = $(".blabla").val();
  // alert(message);  WORK
  alert(e.keyCode);
 }
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top