Can someone enter the history / reasons why the interaction with form elements using NAME disappeared from practice, but document.getElementByIdtook.
document.getElementById
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. "
NAME . , . getElementByName . ID . , , .
NAME
getElementByName
ID
name document.forms[name].element[name]. IE 5.5, Firefox 0.8, Opera 5, Navigator 4 .. , jQuery .
name
document.forms[name].element[name]
input , form, : ,
input
form
<form name="hi" action="/go"><input name="action" value="world">
document.hi.action "/go" "[Input value = world]"?
document.hi.action