Check out event delegation. http://www.mootools.net/docs/more/Element/Element.Delegation
On Nov 21, 2009, at 10:09 PM, Jake <[email protected]> wrote:
I've hit a wall in my quest to figure out how to acquire attribute data from an unordered list. Here's what I'm doing: I have a script that dynamically creates an unordered list as a navigation menu. The only way I can think of to get click information from this list is if there is a specific set number of list items, and have click events for each one. Say a list of 10 items would mean 10 separate click event handlers. 20 list items would mean 20 event handlers. This doesn't seem very elegant to me. But I'm a MooTools noob, so perhaps there is a better way?
