Home > Web Front-end > JS Tutorial > Summary of some practical skills in javascript_javascript skills

Summary of some practical skills in javascript_javascript skills

WBOY
Release: 2016-05-16 18:09:16
Original
1006 people have browsed it
Table object of JS object (excerpt)

Table对象集合

Table对象:表示HTML文档中的表,对于文档中每个

标记,浏览器都创建一个Table对象.

集合

描述

cells[] 获取包含表格中所有单元格的数组
Table object collection

Table object: represents a table in an HTML document. For each

tag in the document, the browser Create a Table object.

Collection

Description

cells[] Get an array containing all cells in the table
js Get the column in the row




Copy code

The 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 the html code, innerText refers to the displayed text);


document.documentElement and document.body This is. The body subnode in the DOMDocument object and the root node of the entire node tree

DOM calls each object in the hierarchy a node, which is a hierarchical structure. You can understand it as a tree structure. Just like our directory, there is a root directory, there are subdirectories under the root directory, and there are subdirectories under the subdirectories

Take HTML Hypertext Markup Language as an example: one root of the entire document is
Understanding of offsetLet, offsetTop, scrollLeft, scrollTop methods

Keywords: offsetlet, offsettop, scrollleft, scrolltop
1.offsetTop:
Current object to the top of its parent layer distance.
cannot be assigned a value. To set the distance from the object to the top of the page, please use the style.top property.

2.offsetLeft:
The distance from the current object to the left side of its superior layer.
It cannot be assigned a value. To set the distance between the object and the left part of the page, please use the style.left attribute.
3.offsetWidth: The width of the current object.
With the style.width attribute The difference is: if the width of the object is set to a percentage width, style.width will return this percentage no matter whether the page becomes larger or smaller, while offsetWidth returns the width value of the object in different pages instead of the percentage value

4.offsetHeight: The difference between
and style.height attributes is


Some knowledge of js operating iframes

1. Print iframe eg. frameName. document.execCommand('print'); 2. Get iframe eg. var ifr_window = window.frames["frameName"]; 3. Get elements in iframe eg1. Change iframe Set the element whose id is elementId to not display: var ifr_window = window.frames["frameName"]; ifr_window.elementId.style.display = 'none'; eg2. Get the id in the iframe is the table of listTable
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template