Web Technology II - JavaScript
Web Technology II - JavaScript
Computer Science
Preface to JavaScript
▪ Self Study
○ IF
○ IF ELSE
○ IF ELSE IF
○ SWITCH
JavaScript Loops
▪ Self Study
○ FOR
○ WHILE
○ DO-WHILE
○ NESTED FOR
JavaScript Input
▪ To access: person.fullName();
▪ this refers to owner of the function.
Various JavaScript Objects
▪ Strings objects
▪ Dates objects
▪ Maths objects
JS Strings
▪ String length
▪ String toUpperCase()
▪ String toLowerCase()
▪ String concat()
JS Strings Methods
JS Dates
Method Description
document.getElementById(id) Find an element by element id.
document.getElementsByTagName(name) Find elements by tag name.
document.getElementsByClassName(name) Find elements by class name.
document.querySelectorAll(tagname.class) Find all elements with specified
class name.
Changing HTML Elements
Property Description
element.innerHTML = new html content Change inner HTML of an element.
element.attribute = new value Change attribute value of an HTML
element.
Computer Science