1) Use a text editor like Apple’s TextEdit to create an .html file, e.g., mytest.html
4) After each change in your .html file, save the file and reload (refresh) the browser page to see the changes.
// two slashes start a comment to help you remember what you are doing, does not execute
document.write('hello'); // display output on web page
// values between ' ' or " " are "strings" of text characters
let aa = 3; // save value 3 in memory location you declare and label aa (aa is a "variable")
// now that a value is stored in new variable aa, we can use the value by using aa
let bb = 2*aa; // multiply 2 times the value in aa and store value in new variable bb
document.write('<br> bb = ' + bb); // note html line break tag <br> to start new line
7) console.log and document.write are standard, built-in “functions.” A function is a block of code to which you can supply input information within the parentheses (e.g., ‘hello’) and returns some output. You can write your own functions so that you don’t have to repeat the same code in different places.
8) You can view the html code of any web page in your browser. In Safari, select Develop > Show Page Source ( command-option-U ).
Here is a link to my examples of interactive controls https://richardherz.github.io/example-controls/index.html
The easiest way to view the code for one of these examples is to go to that example’s code at https://github.com/RichardHerz/example-controls