getElementById returning value only for first element [closed]

Your HTML is invalid (no closing form tags). When is doubt paste your HTML into JSFiddle and look for any red-highlighted elements.

As the ID’ed elements are forms it is having problems with the page.

If you close the first form element the second one is found fine.

Leave a Comment