jquery hotkeys

i'm trying to set a key (alt+a) to equal a tab ("\t") with the code below.  but when i run it the handler reacts to any key not just alt+a
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript" src="scripts/jquery.hotkeys-0.7.8.js"></script>
<script type="text/javascript" src="scripts/jquery.js"></script>
<script type="text/javascript">
  $(document).bind('keydown','alt+a',response);
function response() {
alert("tab");
}
 </script>
</head>
<body>
Hi
<input type="text" name="input1" />
</body>
</html>

Open in new window

jpking72Asked:
Who is Participating?
 
sh0eConnect With a Mentor Commented:
<script type="text/javascript" src="scripts/jquery.hotkeys-0.7.8.js"></script>
<script type="text/javascript" src="scripts/jquery.js"></script>
Wrong order of inclusion, should be:
<script type="text/javascript" src="scripts/jquery.js"></script>
<script type="text/javascript" src="scripts/jquery.hotkeys-0.7.8.js"></script>
0
 
MacAnthonyCommented:
Try this
$(document).keypress( function (e) {
    if (e.which == 97 )
        alert('works');
});

Open in new window

0
 
jpking72Author Commented:
correct shoe...for another 250...what do i tell the handler to do to make it output a "\t" (tab) character?
0
 
sh0eCommented:
"\t"
function response() {
	$('[name="input1"]').val($('[name="input1"]').val() + '\t');
}

Open in new window

0
All Courses

From novice to tech pro — start learning today.