HTML Study Notes (5): html Study Notes
1. Javascript is a scripting language that provides user interaction, dynamic content modification, and data verification.
2. We use the script tag to embed javascript statements into html documents.
3. The script tag pair can be placed in either the head tag or the body tag.
4. If you want to use javascript to pop up a window on the webpage and write your own defined text on it, you can do this:
Alert ("Welcome to R & D department 6! ");
5. A variable is a variable that can change the value. The variable name must start with a letter or underline. The variable can contain numbers and letters. javascript is case sensitive.
6. We use the var keyword to declare variables. var x, y, z = 10 is equivalent to var x = 10; var y = 10; var z = 10;
7. The data types of variables are as follows:
8. Functions in Javascript are used to define methods. The method names are obtained by ourselves, but the method names must be followed by a pair of parentheses and a pair of braces. If we want to call this method in the body, we need to use the onClick attribute.
9. document refers to the current html file. the decimal point (.) is used to obtain its lower-level control or Domain value.
10. The Branch judgment structure in Javascript uses the if and else if statements, & and ,! = Indicates not equal to, | indicates or.