Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE HTML> <html> <head> <title>Title of the Document</title> </head> <body> <form id="form"> <input name="login"> </form> <script> alert(form.elements.login == form.login); // true, it's the same <input> form.login.name = "name"; // change the name of the input // form.elements updated the name: alert(form.elements.login); // undefined alert(form.elements.name); // input // form allows both names: the new and the old alert(form.name == form.login); // true </script> </body> </html>