That you only tested on iPhone and iPad does not make it so that it
"does not work on iPhone and iPad". Well, technically so,
but... it doesn't work in any browser!
Did you bother to look at the Javascript console? You have syntax
errors.
You are making things difficult for yourself with unnecessary
IDs, and long, complicated IDs and names.
Square brackets in names are sometimes a necessary evil when
working with some server software that likes them. Javascript
doesn't like them in strings! If you use the in a string, you have
to "escape" the square brackets with \. And that makes
already-unreadable code even more unreadable.
Are you an optometrist seeking new business? ;)
As well, you missed a single-quote and a right-bracket.
kbWood showed you a readable solution that you only partially
used.