One. Write a JS step
1, first realize the layout
2. In the implementation principle
3. Understanding JS Syntax
Two. js how to get elements
1. Get elements by ID name
var variable = document.getelementbyidx_x ("id name");//element: Element
Three. Move an element out of your sight
1.display:none; Show None
2.visibility:hodden;
Hide
3. Set Width/height to 0
4. Transparency is 0
5.left/top
6. Cover with the same div as the background
7.margin for assignment
Four. Events
Mouse, keyboard, System, form
OnClick onmouseover onmouseout onmouseup onmousedown onmousemove
Five. Add an Event
element. onclick = hide; . Hide is a function that does not add ();
function Hide () {
General that element. Onclick/onmouseover.style.width/background = "200px";
}
Six. read operation of elements and write operations (modify, replace)
element. Value/name = "string";//write operation
var variable = element. Value/name;//Read Operation
+ in JS to indicate the connection
Get the content in P
This is a piece of text
InnerHTML
JS Beginner Learn