diff --git a/src/jqLite.js b/src/jqLite.js index a2dc02cd33ce..d4948f22cbda 100644 --- a/src/jqLite.js +++ b/src/jqLite.js @@ -369,6 +369,9 @@ forEach({ event.cancelBubble = true; //ie }; } + if (!event.target) { + event.target = event.srcElement || document; + } forEach(eventHandler.fns, function(fn){ fn.call(element, event); }); diff --git a/test/jqLiteSpec.js b/test/jqLiteSpec.js index 2c05a7e56ed7..c920a2505b68 100644 --- a/test/jqLiteSpec.js +++ b/test/jqLiteSpec.js @@ -352,6 +352,15 @@ describe('jqLite', function(){ expect(callback).toHaveBeenCalled(); expect(callback.callCount).toBe(1); }); + + it('should set event.target on IE', function() { + var elm = jqLite(a); + elm.bind('click', function(event) { + expect(event.target).toBe(a); + }); + + browserTrigger(a, 'click'); + }); });