Skip to content

Categories:

MooTools target in IE

When using MooTools 1.11 the event object target property can not be read by IE. The way to correct this is to use the following…

        var target = $(e.target || e.srcElement);

Here it is with surrounding code…

 
$('elementId').addEvent('click', function(e) {
	var target = $(e.target || e.srcElement);
	if(target.checked){
		//do something here
	} else {
		//do something here
	}
});

Posted in General.

Tagged with , .


One Response

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. bento says

    Thank-you thank-you thank-you!! This helped perfectly to solve my problem of IE not reading the target property. You have helped to save me a lot of work. :-)



Some HTML is OK

or, reply to this post via trackback.