user521079
user521079

Reputation: 11

descendantOf() causes js error in ie

New to prototype, googled this trouble but didn't find any solution. Works fine in other browsers but alerts an error in ie

        Event.observe(document.body, 'click', function(evt) {
        var element = evt.target;
        if ('sign_in' != element.id  && 'customer_link'!= element.id && !element.descendantOf('sign_in') && !element.descendantOf('customer_link'))
        {$('sign_in').hide();$('customer_link').removeClassName('poped');}
    });

Upvotes: 1

Views: 134

Answers (1)

Dr.Molle
Dr.Molle

Reputation: 117354

Use

var element = evt.element();

instead of

var element = evt.target;

Upvotes: 1

Related Questions