I would like to create new events (using document.createEvent()
or Jquery.Event
+ copying all important attributes) and send the clone to avoid modifying the original event.
Here is the source code http://jsfiddle.net/uymYJ/20/
This question is related to this one How to avoid to modify the event object in this situation
Any ideas why when I type a key on my keyboard I get for newEvent.keyCode
undefined value?
$("#box").keydown(function(event){
var newEvent = $.Event("keydown");
console.log(event.keyCode); // 68
console.log(newEvent.keyCode); // undefined
});