Transfer from:
http://tjian.myrice.com/study_data/script-2/1.htm
We know that if you use the DHTML object model to manipulate the content of the document, you must understand the special properties and methods of the relevant document elements. Because there are many elements of the document, there are many corresponding properties and methods. In order to achieve a function, the developers have to query many data. However, there is a DOM technology, everything becomes simple, and the properties and methods of manipulating documents have an element-independent feature, which allows us to operate document content in the same steps. Undoubtedly, DOM technology provides the most convenient means for developers to operate documents at the subject level.
This article is a comprehensive introduction to how to use the DOM attributes and methods in JavaScript and manipulate documents.
Use Data, NodeValue, and SRC properties
The DOM provides two properties to modify the text node, they are DATA and NODEVALE. The two properties implementation is the same, the syntax is: object.data = "new value" or object.nodevaule = "new value", where Object represents the text item node in the page. If you modify the content of the graphic file, the syntax is: Object.src = "new value", where the Object represents the IMG tag node in the page. Let's take a look at the example below:
this is paragraph 1. P> < P id = "p2node"> this is paragraph 2. P>
this is paragraph 3. this text backs the Image < Table ID = "Tablenode">
Table> P>