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
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,
The getelementsbytagname of JS and $ (élement) of JQ both get the elements in Dom, but they also have some differences and paste the Code:VaR El = Document. getelementsbytagname ('P ');VaR P = ' ';$ ('Body'). append (P );Console. Log (El. Length) //
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,
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
Copy Code code as follows:
function Addevent (o,c,h) {
if (o.attachevent) {
O.attachevent (' on ' +c,h);
}else{
O.addeventlistener (C,h,false);
}
return true;}
var selectrow;//page-level JS variable, used to save the selected rows, and
First declare DOM2 in Nodeiterator and treewalker these two types really just used to play, because performance does not traverse super slow, in JS basically do not use them, in addition to "elevation" there are two or three pages to explain it,
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.