What browser are you having the error in. That is important in web development.
Did you
test to see what getElementById returns?
You should not name your button submit. It overrides JavaScript functionality. It is also good practice not to name your variables the same the form element names.
Side question:
What are you using that has the equals() method? Did you extend String.prototype?