The reason why most javascript forms use ID instead of NAME

Can someone enter the history / reasons why the interaction with form elements using NAME disappeared from practice, but document.getElementByIdtook.

What exactly happened historically, what caused this change and change.

And finally, has there been a shift, or are both still recommended ways to do something?

Document.getElementById vs  document.form.name

According to some forum discussions, document.form.name is not recognized by all browsers. This is true? Cm:

"I've been told in the past that you should not use "document.form_name.element_name" compared to "document.getElementById()", as the first is not recognized by all browsers. "
+5
source share
2 answers

NAME . , . getElementByName . ID . , , .

+3

name document.forms[name].element[name]. IE 5.5, Firefox 0.8, Opera 5, Navigator 4 .. , jQuery .

input , form, : ,

<form name="hi" action="/go"><input name="action" value="world">

document.hi.action "/go" "[Input value = world]"?

+1

All Articles