Skip to content
Advertisement

Capture javascript event in IE Mobile

I need to detect the id of the element that generated an onchange event.

This code work in most modern browsers:

JavaScript

But it does not work in IE Mobile.

I have tried the following code, and at least the event is fired and the handler function is called, but window.event is not available when event handler is called:

JavaScript

Is there any way to obtain a reference to the fired event? Or an alternative approach to know the id of the element that caused the event.

Advertisement

Answer

A workaround would be to pass the element to the callback: (untested)

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement