are some common listsvar oform = document.forms["Form1"]; Get form var otextcomments = oForm.elements.comments;//Get the name attribute for comments Element alert (oform.type);//view element type var otextpasswd = oform.elements["passwd"]; Gets the Name property of the passwd element Otextpasswd.focus ();//focus on a specific element4. Submission of the formThe submission in form is done via a button or a picture with a button function input type =
Precautions for DOM range folding: DOM range folding
var range = document.createRange(refNode);
1. If the range. setEndAfter () or range. setEndBefore () method is called and the setStartAfter () or setStartBefore () method is not called before, the program reports an error.
2. After the setStartAfter () or setStartBefore () method is called, the range. setEndAfter () or range. setEndBefore () method i
Javascript prints the dom tree, and javascript prints the dom.
Copy and paste the following code to the console:
Function render (node, splits) {splits. tag + = '| ----'; console. log (splits. tag + node. tagName); var children = node. children; if (! Children) return; for (var I = 0, len = children. length; I
Source: http://blog.csdn.net/nancle/article/details/43054477
Basic DOM tutorial-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 nama
DOM Tutorial: HTML dom Access Nodes
Here you can access each node of the HTML file.
Access nodeYou can use a node in three aspects:
1. By using the getElementById () method
2. By using the getElementsByTagName () method
3. Through the nodes of the navigation tree, the relationship between nodes is utilized.
The getElementById () methodThe getElementById () method returns the element with the specified
Trigger dom node Event code manually to trigger dom nodes
During code crawling, I encountered a strange problem. You need to manually modify the select value and then manually trigger the select change event. However, the trigger triggered by the trigger and onchange () Events found on the network is not executed, so you have to continue searching. The stackoverflow website also saw the answers from f
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
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.