0

Basically I have a problem with triggering keyup event on input element in. In Firefox it works but in IE7 (or IE 8 in IE 7 mode) it doesn't. Is there a way to make this work (preferably in jQuery)?

I want console to print test each type I type a letter.

EDIT: In hurry I forgot the obligatory jsFiddle link - http://jsfiddle.net/sWfNw/3/

Ok, here is alert which should work in IE regardless of version if I recall correctly.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Daniel Fath
  • 16,453
  • 7
  • 47
  • 82

2 Answers2

1

Basically

jQuery('#inputfield').keyup(function(){ console.log('test'); })

should work even in IE7 - On the other hand it wouldn't be the first bug, you might want to try this:

jQuery('#inputfield').change(function(){ console.log('test'); })
bardiir
  • 14,556
  • 9
  • 41
  • 66
-1

Hi guys thanks for the help, but Michael Swan got it right, IE7 doesn't support console and that was the bug.

Daniel Fath
  • 16,453
  • 7
  • 47
  • 82