w3schools Javascript tutorial
arithmetic operators
(+ - * /)
javascript extension character
.js. Must be placed after sourcing an external file for reference.
assignment operators
=
What can document.getElementById() change?
Everything in a webpage.
Javascript rule
Numbers are not allowed as the first character. Hyphens are not allowed.
Most important rules for fixed values
Numbers are written with or without decimals Strings are text, written within double or single quotes.
Benefits to external files
Separates HTML and Javascript Makes HTML and Javascript easier to read Faster page loads
Syntax
Set of rules how code programs are constructed.
FUnction
a block of code that can be executed when called for.
An expression
a combination of values, variables and operators which computes to a value.
How document.getElemementById().innerHTML works
document.getElementById specifies that you want to manipulate the information marked by an id. The target id is to be placed in the () and innerHTML specifies the contents. = specifies to what you want to change the content.
Types of values in Javascript
literals and variables
=
operator used to assign values
Event
something that happens in the code, like someone clicking.
Camel Case
when the first letter of a separate word in a variable is capitalized. Example: CamelCase
Possible display tags
window.alert() document.write() innerHTML. console.log()