I've added a simple span element before an anchor element. I want to remove this span later (no id on either element btw). I'm using mootools 2.x (and my jQuery chops don't seem to be helping much here)
I assumed a simple $(this).prev().remove()开发者_StackOverflow中文版 would work but not with mootools - anyone help?
the html looks something like this
<span>fail</span><a href="#" onclick="...">link</a>
within the click handler callback - and don't use onclick, use element.addEvent("click", function() {});
instead:
remove totally:
this.getPrevious().destroy();
detatch from dom:
this.getPrevious().dispose();
精彩评论