Hi all,

I noticed on the Prototype site, 
http://www.prototypejs.org/api/event#method-observe,
that Prototype 1.6 defines instance methods on the event objects.

I tried it out, and unless I am mistaken, it does not work in IE6.

default.htm
----------------
<input type="button" name="btn" id="btn" value="click me" />

default.js
----------------
Event.observe(window, 'load', init);

function init(){
        Event.observe('btn', 'click', respondToClick);
}

function respondToClick(event) {
        //ok
        //var element = Event.element(event);
        //element.addClassName('foo');

        //not in IE6
        var element = event.element();
        element.addClassName('foo');
}

styles.css
----------------
.foo {border: 1px solid red;}


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to