The first week of learning Html5+css3+javascript

Source: Internet
Author: User
Tags null null

JavaScript is a lightweight, interpreted, web-development language. JS code needs to be written in the <script></script> tag, as the identifier of the scripting language to separate other source code. Avoid confusion with HTML tags and CSS styles.

JS codes are strictly case sensitive. JavaScript temporarily does not support the constant keyword and does not allow users to customize constants. JavaScript uses the VAR keyword to declare variables, declare them before they are declared, and, after declaring a variable, its initial value is undefined (undefined value) before it is initialized. Variable naming rules: 1. The first character must be uppercase or lowercase letters, underscores, or dollar characters, followed by letters, numbers, underscores, dollar symbols, 2. The variable name cannot be a JavaScript keyword or a reserved word. 3. Variable names are arbitrary in length, but are case sensitive. (Note: Variable names should be easy to understand).

Data type: String string Number Value Boolean Boolean value null null undefined undefined object.

Operator: arithmetic operator logical operator bitwise operator ASSIGNMENT operator the operator special operator conditional operator (? :) is also the only ternary operator of JavaScript

Here is a little bit of JS I used to make a progress bar

<section> <p>percent Progress:<progress id= "Progress" max= "><span>0</span>%</progress></p> <input type=" Button "onclick=" Click1 () "value=" Show progress/> </section> <script>functionClick1 () {varProgress=document.getelementbyid ("Progress"); Progress.getelementsbytagname ("Span") [0].textcontent= "0";  for(vari=0;i<=100;i++) {updateprogress (i); }} Function UpdateProgress (newvalue) {varProgress=document.getelementbyid ("Progress"); Progress.value=NewValue; Progress.getelementsbytagname ("Span") [0].textcontent=NewValue; }        </script>

The preview results are as follows:

The first week of learning Html5+css3+javascript

Related Article

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.