Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form name="my_form" id="my_form"></form>
- var form = document.forms[0]; // Not the best choice due to hard-coding an index.
- var form = document.forms["my_form"]; // Retrieves the form by name
- var form = document.getElementById("my_form"); // Retrieves by ID.
Add Comment
Please, Sign In to add comment