Pergunta

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}
Foi útil?

Solução

Change your code to :

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

function comment(e,id) {
  var comment = $(".blabla").val();
  // alert(message);  WORK
  alert(e.keyCode);
 }
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top