Writing to attributes is fine but for custom properties I ended up
with this little helper (I know the name is idiotic but I had no time
to think of a good one):

Element.addMethods({
  __extend: function(element, hash) {
    return Object.extend($(element), hash)
  }
});

then just do:

$('a').__extend({
  property1: 'value1',
  property2: 'value2'
})

$$('a').invoke('__extend', {foo: 'bar'}) // adding "foo" property with
"bar" value to all "a" elements

P.S. special thanks goes to Matt Foster for advising to use
"Object.extend" instead of "for .. in"


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to