DOM study notes 5: dom Study NotesDOM table creation:Create a table with five rows and five columns on the page1. Event source, button
2. There must be a storage location for the generated table Node
Second:Create a table with the specified number of rows and columns, and delete the specified rows and columns.
Display the row color interval and highlight it:Mouse touch, highlighted
Table sorting:
This article describes how to use DOM control forms in basic DOM tutorials. For more information, see
1. Form Overview
Form
Generally, each form element should have the name and id attributes. name is used for handing over to the server, and id is used for binding and functional filtering.
2. Access elements in the form
Elements in the form, whether in the text box, single-choice button, drop-down button,
HTML Dom tutorial 5-html Dom node access
1: common methods for finding and accessing nodes
Use the getelementbyid () and getelementsbytagname () methods;
Use the parentnode, firstchild, and lastchild attributes of an element node;
Access the document root node.
2: getelementbyid () and getelementsbytagname ()
Getelementbyid () and getelementsbytagname () can be used to find any HT
HTML Dom tutorial 9-html Dom window object
1: Window object
Window objects are top-level objects in the Javascript level.
A window object represents a browser window or framework.
The window object is automatically created every time
2:
Set of window objects
Collection
Description
IE
F
O
Frames []
Return to all named frameworks in the
HTML Dom tutorial 38-html DOM object
1: link object
An object represents the
2: link object properties
Attribute
Description
IE
F
O
W3C
Align
Sets or returns the alignment of the object according to the surrounding text
5
1
9
Yes
Archive
Sets or returns a string that can be used to implement your own archive functionali
ArticleDirectory
2: syntax for using style object attributes:
Csstext attributes
HTML Dom tutorial 41-html Dom style object
1: style object
The style object represents a separate style declaration. You can access the style object from the document or element of the application style. 2: syntax for using style object attributes:
Document. getelementbyid ("ID"). style. Property = "valu
HTML Dom tutorial 16-html Dom area object
1: Area object
An area object represents an area mapped to an image (image ing refers to an image with a clickable area)
Each time a
2: attributes of the Area object
Attribute
Description
IE
F
O
W3C
Accesskey
Set or return the shortcut key for accessing a region.
5
1
No
Yes
ALT
Small DOM exercises, data movement between two tables, dom tables
This article describes how to move data between two tables. The table on the left is moved to the right, and the table on the left disappears.
Basic DOM Tutorials: Using DOM control forms
1. Form Overview
Form In javascript, you can easily operate forms, such as obtaining form data for effective verification, automatically assigning values to form fields, and Processing Form Events.In this case, each form is parsed as an object, that is, a form object. These objects can be referenced through the document. forms set. For example, a form with the na
Html dom tutorial 17-HTML DOM Base Object
1: Base Object
The Base object represents the base element of HTML.
Each time 2: attributes of the Base Object
Attribute
Description
IE
F
O
W3C
Href
Sets or returns the Reference URL for all links on the page.
5
1
9
Yes
Id
Sets or returns the id of the
4
1
9
Yes
Target
Sets or retu
Table CSS control is not to say first, share the following table common Dom
The methods commonly used for table add operations are the InsertRow () and Insertcell () methods.
The row is calculated from zero, for example:
Copy Code code as follows:
var oTr = document.getElementById ("member"). InsertRow (2)
refers to adding a new row to the second row.
Copy Code code as follows:
var atext = new Array ();
At
With the original JS in the parent page to get the elements of the IFRAME, as well as in the child page to get the parent page elements, this is often used in the method, here to write an example to sum up:
1, the parent page (demo.html), the parent page to modify the child page div background color is gray, the original is red:
2, sub-page (demo-iframe.html), the child page to modify the parent page div font color is red, originally black:
3, the effect chart:
(1
These are all very basic and very simple. I wrote them down because I was afraid I could not remember them for a moment. Now I can take a look and consolidate my basic knowledge by the way.
The Code is as follows:
Var props = {'For': 'htmlfor ','Class': 'classname ',Readonly: 'readonly ',Maxlength: 'maxlength ',Cellspacing: 'cellspacing ',Rowspan: 'rowspan ',Colspan: 'colspan ',Tabindex: 'tabindex ',Usemap: 'usemap ',Frameborder: 'frameborder'}
When an object is created in json format, we re
This article describes how to use DOM to control tables in basic DOM tutorials. If you want to use DOM to control tables, you can refer to the css control in the following table.
The insertRow () and insertCell () methods are commonly used to add tables.
Row is calculated from scratch, for example:
The Code is as follows:
Var oTr = document. getElementById (
Some DOM object methodsHere are some common ways you'll learn in this tutorial:
method
description
getelementbyid ()
Returns the element with the specified ID.
getelementsbytagname ()
Returns a list of nodes (a collection/node array) that contains all the elements with the specified label name.
getelementsbyclassname ()
Returns a list of nodes that contain all
HTML Dom tutorial 10-html Dom navigator object
1: navigator object
The navigator object is actually a JavaScript Object, not an html dom object.
The navigator object is automatically created by the Javascript runtime engine and contains information about the client browser.
2: Set of Navigator objects
Set
Description
IE
F
O
DOM note (10): JavaScript Regular Expression and dom Regular Expression
1. RegExp
ECMAScript supports regular expressions through the RegExp type class. The syntax is similar to Perl:
Var exp =/pattern/flags;
The patternb part is any simple or complex regular expression. flags is one or more of the symbols carried by each regular expression.
Regular Expression Pattern Matching supports three tags:
G: Glob
DOM operation table, dom table
CSS Classification
Intra-row:
Inline: the HTML header is generally in the following format:
Link: introduce a separate CSS file in HTML. The format is as follows:
First, let's take a look at JS operations on CSS.
JS can be used to obtain and set intra-row styles.
Each element in HTML has an attribute object style, which contains all the css styles of the element. Th
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.