If the name attribute is set in the html tag corresponding to a, form object, image object, applet object, its value will be used as the attribute name of the document object to refer to the corresponding object and other objects. It is not possible.
In addition, if input is used as a sub-element of form, it is wrong to directly use inputName or document.inputName to reference this object. You must use formName.inputName to reference, otherwise you can use inputName to reference.
In addition, you should Notice that there are many commonly used elements without names.
If you want to reference an element with an id, you can only use Id or document.getElementById, document.all.id to reference
But for elements like this, so
like ...... can be used
linkid.href ;
linkname.href;
document.all.linkid.href;
document.all.linkname.href;
document.getElementById("linkid").href;
document.getElementsByName ("linkname")[0].href to reference
all is a collection that contains all html objects. Write a program to access all objects. Like this:
Be careful to put the program after