1.
Open page: window.open ();
Close page: Window.close ();
2.
The timer has a return object that returns the object of this timer
SetInterval ();//serial Bomb interval execution
SetTimeout ();//Time Bomb delay execution
Cleaning timers
var sett = setTimeout (function () {
Console.log ("settimeout timer");
},3000);
var sett1 = setinterval (function () {
Console.log ("setinterval timer");
},1000);
function closedsq () {
Cleartimeout (sett);//Clear Delay Timer
}
function closedsq1 () {
Clearinterval (SETT1);//clear the serial timer
}
3.
Page loading complete
Window.onload=function () {
}
4.
Find element
To find a specific element, the element object is returned:
Finding a class of elements returns an array of multiple element objects:
5.
Manipulating elements
Manipulating the contents of an element
Non-form elements: dom.innerhtml
Form elements: Dom.value
6.
Manipulating element properties
Dom.getattribute ("AAA");//Get property value
Dom.setattribute ("id", "dd");//Set property value
Dom.removeattribute ();//Remove attribute values
7.
manipulating element styles
Dom.style.color;
8. Manipulating element Events
1. Add event attributes directly inside the tag
2. Dom.onclick = function (e) {}
3, Dom.addeventlistener (event name, method name);
Dom.removeeventlistener (method name);
9. Action element Add Delete
var d = document.createelement ("div")
D.innerhtml
D.styl
D.set
Dom.appendchild (d);
Dom.remove ();
<TD onclick= "Editthis (This)" > ' +stus[k][0]+ ' </td>
Learn JS Basics Operation Summary