1,105,375 Community Members

Compete action by pressed key

Member Avatar
RikTelner
Junior Poster
140 posts since Jan 2013
Reputation Points: 4 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
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.

Member Avatar
RikTelner
Junior Poster
140 posts since Jan 2013
Reputation Points: 4 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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

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