http://www.w3schools.com/js/ uses of js inject dynamic text into a web page (document.write) validate data respond to events detect browser cookies putting a js script into a page link if in head, called when executed by an event if in body, called when page is loaded variables var strname = some value or strname = value local vs. global variables operators + - * / % ++ -- = += -= *= /= %= == != > < >= <= && || ! (same) + concatenates Strings (same) === checks for equal value AND type (== just checks value; 5 and "5" would be equal) strings escape characters with \ (same) \' \" \& \\ \n \t .length .toUpperCase() http://www.w3schools.com/js/js_obj_string.asp if, if/else, nested if/else (same) if (condition1) { code to be executed if condition1 is true } else if (condition2) { code to be executed if condition2 is true } else { code to be executed if condition1 and condition2 are not true } message boxes alert("text") varname = prompt("message", "defaultvalue") if (confirm("text")) { ... } for (var=startvalue;var<=endvalue;var=var+increment) { code to be executed } while (test) { code to be executed } do { code to be executed } while (test) break, continue (same) // foreach loop for (variable in object) { code to be executed } comments: // /* */ functions function functionname(param1,param2,...,paramX) { some code } events http://www.w3schools.com/js/js_events.asp onload, onUnload, onfocus, onblur, onchange, onsubmit, onMouseOver, onMouseOut, onError onerror event