<!DOCTYPE html>
<html>
<body>
<input type="text" onkeypress="handleEvent(event)" name="FirstName" style="position: absolute; left: 50px;">
<script>
        function handleEvent(e){
           if(e.keyCode === 13){
                <?php 
                echo "hello";
                ?>
            }
        } 
</script>
</body>
</html> 
If I remove the PHP code in function and put alert("something") it works fine. But when I put an echo in PHP in function, "hello" is not displayed. Please help me, struggling from 2 days.
 
    