Wednesday, January 14

Learning Javascript: Class 1

 Tools:

Notepad, Chrome


Step 1,

Open Notepad or any editor, create a file "class1_1.html" with the content:




Step 2,

Use Chrome to open this file (Usually, by double clicking this file in File Explorer)

Open "More Tools"->"Developer Tools" to see the information.


Now you learn the development environment of Javascript.


Step 3,

Open Notepad to create second file "Class1_2.html" with the content:


Now you learn how to output value to the web page (UI)


Step 4,

Next file, more complicate:



Fun, you are interacting with the page!

The result is not quite right, can you correct it?


Step 5, 

In the previous program, the operator is always plus ("+"). Can you change it to a drop box with 4 choices ("+", "-", "*", "/"), and change the program to reflect the change?