I need help with the following problem.
var xspanid = .. whatever ...
the code above works (I've included two lines that I think are
equivalent and both work the same, just . The problem I'm having is
that deleteitem is only bound to the most recent span to which I
attach this event, instead of to all of them.
on the other hand, if I run a loop on all the spans together and
attach the events within that loop, then they all work. But only want
to attach an observer once, at the moment the span is created.
The difference in the loop is that one is cycling through dom element,
such as :
X = $$('span.xspan'); // gets a collection of span elements I'm
// Event.observe(item, "click",
so "item" is not the same sort of thing as "xspanid" above. Thus, I
tried it like this as well:
with exactly the same results. Only that last span that gets passed
through here gets an observer attached to it.
I really don't understand why it works just as well, to the extent
that it does, with either an element id or the whole element as the
first argument. But that's another question.
Thanks in advance for any help.