JS Object Table Table object (excerpt)
Table Object Collection Table object: Represents the tables in an HTML document, and the browser creates a Table object for each <table> tag in the document. |
Collection |
Describe |
Cells[] |
Get an array that contains all the cells in a table |
JS fetch row in column
Copy Code code as follows:
var tbodyobj = document.getElementById (Tbodyid);
Tbodyobj.rows[rowid].cells[colid].innertext = "ABCD";
tbodyobj.rows[rowid].cells[colid].innerhtml = "ABCD
(innerHTML refers to the HTML code, innertext refers to the display of text);
document.documentelement and Document.body.
This is the root node of the body child node and the entire node tree in the DOMDocument object.
Dom refers to each object in the hierarchy as a node, is a hierarchy, you can understand as a tree structure, like our directory, a root directory, the root directory has subdirectories, subdirectories also have subdirectories.
In the case of HTML Hypertext Markup Language: One root of the entire document is <HTML>, which can be accessed using document.documentelement in the DOM, which is the root node of the entire node tree. And the body is a child node, to access the body tag, in the script should be written: Document.body.
understanding of several methods of Offsetlet,offsettop,scrollleft,scrolltop
Keywords: offsetlet, offsettop, ScrollLeft, scrolltop
1.offsetTop:
The distance from the current object to the top of its parent layer.
It cannot be assigned. Set the distance of the object to the top of the page use the Style.top property.
2.offsetLeft:
The distance from the current object to the left of its parent layer.
It cannot be assigned. Set the distance of the object to the left part of the page using the Style.left property.
3.offsetWidth:
The width of the current object.
The difference with the Style.width property is that if the width setting of the object is a percentage width, the style.width returns this percentage, regardless of whether the page is larger or smaller, and offsetwidth returns the width of the object in different pages instead of the percent value
4.offsetHeight:
The difference between the Style.height property and the
some knowledge of JS operation IFrame
1. Print iframe
eg. FrameName.document.execCommand (' print ');
2. Get IFRAME
eg. var Ifr_window = window.frames["FrameName"];
3. Get the elements in the IFRAME
Eg1. Place the element with ID ElementID in the IFRAME as not displayed:
var Ifr_window = window.frames["FrameName"];
Ifr_window.elementId.style.display = ' None ';
EG2. Get the table with ID listtable in the IFRAME