Change your code to :
onkeyup="comment(event,'your string')">
function comment(e,id) {
var comment = $(".blabla").val();
// alert(message); WORK
alert(e.keyCode);
}
سؤال
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);
}