Document. getelementsbyname () obtains the control object based on the control name. Because the control name can be the same, an array of objects is returned.
Document. getelementbyid () is used to obtain the control object based on the control ID.
ie in JS getElementsByTagName cannot get element bugs
Definitions and usageThe getElementsByTagName () method returns a collection of objects with the specified label name.
Grammardocument.getElementsByTagName (tagname) descriptionThe order in
Getelementbyid getelementsbyname getelementsbytagname difference and summary
1st Floor
Getelementbyid getelementsbyname getelementsbytagname difference and summaryIn the Web standard, you can use getelementbyid (), getelementsbyname (),
function tag (Name,elem) {if (!document.getelementsbytagname) return false;Return (Elem | | document). getElementsByTagName (name);}
document.getelementsbyclassname = function (Classname,obox) {
Applies to getting all HTML elements
In the Web standard, you can use getelementbyid (), getelementsbyname (), and getelementsbytagname () to access any tag in the document.
(1) getelementbyid ():
Getelementbyid () can access a specific element in the document. As the name suggests,
In the Web standard, you can use getelementbyid (), getelementsbyname (), and getelementsbytagname () to access any tag in the document.
(1) getelementbyid ():
Getelementbyid () can access a specific element in the document. As the name suggests,
Reference: http://www.w3school.com.cn/jsref/met_doc_getelementsbytagname.aspHTML DOM Document ObjectDefinition and usageThe getElementsByTagName () method returns a collection of objects with the specified label
Web standards can access any of the tags in the document through getElementById (), Getelementsbyname (), and getElementsByTagName ().(1) getElementById ():getElementById () can access a specific element in the document, as the name implies, by
The table structure of HTML is as follows:Copy codeThe Code is as follows:Class = "tableStyle1" cellspacing = "0"> NO. Part Model part name quantity no tax price tax-included price Tax Amount payment integer operation 1 Readonly = 'true'/
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.