Guest User

Untitled

a guest
Jun 25th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. <form name="my_form" id="my_form"></form>
  2.  
  3. var form = document.forms[0]; // Not the best choice due to hard-coding an index.
  4. var form = document.forms["my_form"]; // Retrieves the form by name
  5. var form = document.getElementById("my_form"); // Retrieves by ID.
Add Comment
Please, Sign In to add comment