JS Beginner Learn

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.