1.HTML Property Manipulation: Read, write
Property name
Property value
2. Property read operation: Get, find
A) Syntax: element. Property name
such as: document.getElementById ("BTN"). Value;
b) connection of strings: +
3. Property write Operation: ("Add") Replace, modify
A) Syntax: element. property name = new value
such as: document.getElementById ("BTN"). Value = "Well, Coax ~ change Change";
4 . Element content operations:("add") Replace, modify
op.innerhtml Read all HTML content within an element
op.innerhtml = new value Replace all HTML content within the element
5.a=a+b =====> a+=b
6. Read and write operation precautions:
Note Reserved words and keywords
a) reserved word: Class ...
b) Keywords: var, function,...
Precautions
A) do not judge all the relative paths!
b) Color values do not take to make judgments!
c) InnerHTML do not take it for judgment!
7. How to use the "[]":
ODiv.style.width = Obtn1.value; The following values cannot be changed.
Odiv.style[width] = Obtn1.value; [] The value inside can be changed
JS allows the " . " become " []", such as Obtn.onclick ===> obtn['onclick']
JS Learning Note 2---HTML property operations