Benefits of JavaScript
JavaScript
Arrays
JS and CSS
document.getElementBy__()
dot notation
camel case
HTML to JSS class change options
HTML: div id=”tb” class=”box”
JS: var tb = document.getElementbyId(“tb”);
tb.className = “newbox”;
tb.className = “box newbox”;
Event handling - event listeners
2 main ways to add event listeners
Inline event listener
2 types of timer events
Conditionals
Functions
what are the parameters to function average (x,y) {
var z = (x+y)/2;
document.write(“result: “ + z);
}
x and y
Loops
Form modifications
show/hide a form field
Add a new text input box into the “con” container
var x = document.createElement(“input”)
x.type = “text”;
x.className = “contact”;
x.id = “provinceBox”;
var c = document.getElementById(“con”);
c.appendChild(x);
validate web forms
get input to examine for validation
isNaN() function
checks if value is Not a Number