ANSWERS: 2
  • document.getElementsByName returns an array (as indicated by the use of the plural elements). You must either cycle through the elements returned or provide an index.
  • document.getElementsByName('myInput').item(index), you can use the document.getElementsById() interface, furthermore,The value of the id attribute is intended to be unique within a document, and if this method finds more than one Element with the specified elementId, it may return one at random or it may return null.

Copyright 2023, Wired Ivy, LLC

Answerbag | Terms of Service | Privacy Policy