Prototype extends HTML Elements with functions that proxy to the Element class. So "remove()" is really calling "this.remove()", which gets proxied to "Element.remove(this)", which removes the <input> element.

I would recommend renaming the remove function.

On Oct 20, 2006, at 3:26 PM, Michael Peters wrote:


So prototype provides Element.remove(). In an html file I also have a function
named remove(). Why do these clash when I do the following:

  <input type="button" value="Delete" />

Instead of calling the remove function I defined, it actually removes the delete
button.

-- 
Michael Peters
Developer
Plus Three, LP



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" 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/rubyonrails-spinoffs
-~----------~----~----~----~------~----~------~--~---

Reply via email to