T.J. Crowder wrote:
I know the divs will have IDs, so how would I write it to just use the id property ?Hi,On Jan 10, 7:08 pm, bill <[email protected]> wrote:DJ Mangus wrote:What is returned is the same thing you'd get if you used $('id'). Chain on .identify to get the Id from a DOM node.Thank you. as in: function clickHander (event) { var id = event.element().identify ? or rather: function clickHander (event) { var element= event.element() var id = element.identify()The latter, since #identify is a function. (Don't forget your semicolons, though!) FYI, Tobie says that Event#element is deprecated and we should use Event#findElement with no arguments instead, so: function clickHandler(event) { var id = event.findElement().identify(); } Also note that if you know the element will have an ID, or if you don't care if it doesn't, you can just use the `id` property. Element#identify just returns `id`, but it checks first to see if the element *has* an ID and if not it assigns one to it.
--
Bill Drescher (who is still climbing the learning curve)
william {at} TechServSys {dot} com
-- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" 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/prototype-scriptaculous?hl=en.
