HTMLCollection test

What does an HTMLCollection return, when there are two elements, one with an id, the other with a name?

by marcoos

HTML

<form method="get" id="myForm">with id</form>
<form method="get" name="myForm">with name</form>

JavaScript

var myForm = document.forms.myForm;

if (myForm.innerHTML) {
    alert("myForm is an element: " + myForm.innerHTML);
} else {
    alert("myForm is " + Object.prototype.toString.call(myForm));
}