Small javascript instance [Notes for Lesson 1]

Source: Internet
Author: User

What does dot in js indicate. Equals signs are assigned to a variable. When there is content in the document, that is, the window is used for marking. onload is used to call a function for execution. Otherwise, the browser will not execute it. Generally, the script is placed before the </body> label to load the structure and style first, finally, load the script file, which is conducive to the user experience and the principle of accessibility.

Let's start with the first small instance today. In fact, it was done yesterday. Today it is pasted as =!

1 <! DOCTYPE html> 2 

This is something similar to a prompt box. You will understand it and will not explain it. The label can be used to contain the input element. When you move the mouse over the text, the onmuoseover event will also occur.

 

The second small instance:

 1 <!DOCTYPE html> 2 

This instance uses className to change the class name to implement style switching. Pay special attention to every punctuation mark. If you have more Punctuation Marks, you will be wrong. In addition, the div in the style label cannot use # div1. Otherwise, an error may occur. I don't know what the problem is. I found it during debugging.

 

  1. This guy () must be added to the function call and can be used multiple times, similar to the class in css.
  2. GetElementByID ();
  3. Alert ();
  4. Onclick;
  5. Onmouseover/onmouseout;
  6. ClassName;

END !!

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.