I have a javascript function that would not run and threw an error. It took about an hour to realize that my form had the same name as the function. It seemed odd that a for
The function is a member in the window
object, and the form is a member of the forms
collection in the document
object. When the script looks for a match for the identifier "mytest", it first looks in the document
object, and if it's not found there it looks in the window
object.
You can access the function even with the conflicting form name if you specify that it's in the window
object:
Click Me