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