Jeanne Boyarsky wrote:Quite literally:
There are other ways to make the code better though. Passing the parameters isn't necessary. You could get those directly as well. Or you could use a library like jQuery to make the code shorter.
Note that getElementByName doesn't do the same thing as getElementsById. Names are not guaranteed to be unique on a page.
Thanks Jeanne. I haven't tried it yet but what you wrote looks good. The code I posted was using only the name attribute because, as you probably know, it's designed to work that way. Thanks for the pointers and advice.