One of the things we do very frequently is assign unique IDs to  
elements for faster access later. Of course, this is really simple  
and I'm wondering whether it would make a good addition to the  
Element suite of methods:

     Element.Methods.assignId = function(element) {
         element= $(element);
         if (!element.id)
             element.id= "uniqeId_" + (arguments.callee._nextUniqueId+ 
+);
         return element.id;
     }
     Element.Methods.assignId._nextUniqueId=0;

This can then be used as follows:

     this.myElement= $(e).assignId();
     .
     .
     .
     var e= $(this.myElement)

I don't know whether this would be useful for anyone else, but I know  
we'd use it.

--
Jeff Watkins
UI Engineer, Online Apple Store
--~--~---------~--~----~------------~-------~--~----~
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