1.11M Members

Compete action by pressed key

 
0
 
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/js">
    $(document).keydown(function(e){
        if (e.keyCode == 37) { 
            alert( "Left");
            return false;
        }
    });
</script>

How to make this work? I am using Firefox and don't I get this working.

 
0
 

Appearentely I should have added "" around 37 thus "37".

Question Self-Answered as of 7 Months Ago
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article