Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

0 Basics js


May 29, 2021 Article blog



JavaScript is already well known as the front-end language of the three swordsmen, and today comes with a small summary for novices

JavaScript is a weak type of scripting language that enables web page effects:

1. JS is used as a control structure (HTML) and style (CSS) to achieve web page effects.

2, generally use console .log to detect the code

3. Assign the value on the right to the variable on the left with a """"

4, function definition refers to a certain function of the code block, declaring that the function has no call no effect

5, common data types: String (string), Number (number), Boolean (Boolean), null (empty), undefined (undefined)

6, composite data type: object type object, function type Function array Array

7, the naming rules of variables:

8, events:

The name of the event illustrate
onclick Mouse click
ondblclick Double-click with the mouse
onkeyup Triggered when a key on the keyboard is pressed and released
onchange The options in the text content or drop-down menu change
onfocus Gets the focus, which means that the text box gets the mouse cursor
onblur Loss of focus means loss of mouse cursor, such as text boxes
onmouseover Mouse hover, that is, the mouse hovers over the picture and so on
onmouseout Move the mouse out, away from the area where the picture, etc. is located
onload Web document loading event
onunload When you close a Web page
onsubmit Form submission events
onreset Reset the form

9, familiar with the three major structures: sequential structure, selection structure, cycle structure

10, familiar with and master if, while, for, switch statements, etc.

That's all the little editor brings you about 0 Basics js.