SyntaxFix
Write A Post
Hire A Developer
Questions
Note the plural in this method:
document.getElementsByName()
That returns an array of elements, so use [0] to get the first occurence, e.g.
document.getElementsByName()[0]