<分区>
有人可以深入了解使用 NAME 与表单元素交互的历史/原因已经过时,而 document.getElementById
已接管。
究竟是什么历史事件促使了这种变化和转变。
最后,是否发生了转变,或者两者仍然是推荐的做事方式?
Document.getElementById vs document.form.name
根据一些论坛讨论,document.form.name 并非被所有浏览器识别。是这样吗?见:
"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. "