سؤال

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