Recently, a friend used a form named as a keyword in form, causing the failure to reset and submit. It turned out to be the problem "an error is returned when document. forms [0]. reset () is called ?", Ask him right away: "Is there a form on the page ?", A: Yes ". "You alert document. forms [0]" and "the object is displayed ". That's strange. When does form have a reset method?
In the past, alert (document. forms [0]. reset) found that the object popped up is incorrect. The reset local method should pop up. Search for reset and find that the original reset button name is reset. No wonder an error occurs. document. forms [0]. reset points to the reset button instead of the reset interface of the form.
Remove name = "reset". Everything is OK!
In fact, it was also found that the name of its submit button is submit, and it is estimated that the submit method will also be wrong!
Khan: I don't know whether it is software or written by myself. Remember not to use these keywords to name them. It is easy to see unexpected errors!