jpking72
asked on
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>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
correct shoe...for another 250...what do i tell the handler to do to make it output a "\t" (tab) character?
"\t"
function response() {
$('[name="input1"]').val($('[name="input1"]').val() + '\t');
}
Open in new window