While getElementsByTagName is part of the core DOM specification:
getElementsByName is defined only for the HTMLDocument object.
Considering your particular example:
1. Starting HTML 4.01 (maybe earlier) name attribute can not be used with div element (and most elements as well). It was left mostly for backward compatibility with form elements. So you should not be using it like that.
2. You can retrieve the same list of nodes by:
or if you remove all the extra white space within the myid element by simple:
EDIT beetle edited his replay behind by back