Quad selector: class, ID, name, label
To get an object from a selector:
................................... ClassName ("); --Class Selector
............................... Name ("); --Name Selector
................................ TagName ("); --Tag Selector (that is, Div.) Tag name such as input)
Gets the element into the variable (except for the ID, the other gets the array, the index value should be used)
var A=document.getelementbyid ("Element id"); "The type has only one value, and the operation uses a. Event directly"
var a=documenr.getelementbyclassname ("Class name"); "The type is an array that can use a for loop for a single element operation within a group: A[i]. Event"
Three events
1. Click events [onclick]
A.onclick=function () {}
2. Mouse move-in event [onmouseover]
A.onmouseover=function () {}
3. Mouse out event [onmouseout]
A.onmouseout=function () {}
Control the style of the marker
1. Element tag. style. style = "value";
Change the background color of the ID ' AA ' to Black: aa.style.backgroundcolor= "red";
Here the Background-color becomes Backgroungcolor, is the JS in all the "-" attributes are removed, and the first letter behind it becomes uppercase.
2. The first element is a[0] When the array data is traversed for a loop.
To mark style operations on an element in a loop, the style of theJS change changes all styles (inline style has the highest precedence)
JS Windows.document Object