[jQuery] $(document).keydown only works in FireFox?
Hello,
i tried to use jQuery for cross browser compatibility...I want to execute a
click on a Button when Enter got pressed on page...
but the following script still only works in FireFox and not in IE.
can anyone help me or have an idea?
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$(document).keydown(function(evt) {
if (!evt)
evt = window.event;
if (evt.keyCode == 13) {
// alert("enter captured from IE");
$("btnCanelEditUser").click();
}
else if (evt.which == 13) {
// alert("enter captured from Gecko, Opera");
$("btnCanelEditUser").click();
}
});
});
</script>
--
View this message in context: http://www.nabble.com/%24%28document%29.keydown-only-works-in-FireFox--tp21289326s27240p21289326.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.