Table objects of JS objects (excerpt)
Table object set Table object: The table in the HTML document. For each <Table> mark in the document, the browser creates a Table object. |
Set |
Description |
Cells [] |
Returns an array containing all cells in the table. |
Js retrieves columns from the row
Copy codeThe Code is as follows:
Var tbodyObj = document. getElementById (tbodyID );
TbodyObj. rows [rowID]. cells [colID]. innerText = "abcd ";
TbodyObj. rows [rowID]. cells [colID]. innerHTML = "abcd
(InnerHTML refers to html code, and innerText refers to the displayed text );
Document.doc umentElement and document. body.
This is the root node root of the body subnode and the entire node tree in the DOMDocument object.
DOM calls every object in a hierarchy a node, which is a hierarchy. You can think of it as a tree structure. Just like our directory, a root directory contains subdirectories, there are also subdirectories under the subdirectory.
Take HTML hypertext markup language as an example: a root of the entire document is
Understanding of offsetLet, offsetTop, scrollLeft, and scrollTop Methods
Keywords: offsetlet, offsettop, scrollleft, scrolltop
1. offsetTop:
The distance from the current object to the top of the upper layer.
You cannot assign a value to the object. Use the style. top attribute to set the distance from the object to the top of the page.
2. offsetLeft:
The distance from the current object to the left of its upper layer.
You cannot assign a value to the object. Use the style. left attribute to set the distance from the object to the left of the page.
3. offsetWidth:
The width of the current object.
And style. the difference between the width attribute is that, for example, if the width of an object is set to the percentage width, the style is displayed regardless of whether the page is larger or smaller. both width return this percentage, while offsetWidth returns the width value of the object in different pages instead of the percentage value.
4. offsetHeight:
The difference between the style. height attribute and the style. height attribute is as follows:
Knowledge about js iframe operations
1. Print iframe
Eg. frameName.document.exe cCommand ('print ');
2. Get iframe
Eg. var ifr_window = window. frames ["frameName"];
3. Get the element in iframe
Eg1. set the element whose id is elementId in iframe to not display:
Var ifr_window = window. frames ["frameName"];
Ifr_1_elementid.style.display = 'none ';
Eg2. obtain the table whose id is listTable in iframe.