.JS BUILDING BLOCKS
- Objects – documents, html tags, images, strings, functions, console – everything!
- An object is just a special kind of data, with properties and methods.
- Properties – values associated with an object – color, length, substring
- Methods – (functions) – VERBS – write, confirm, alert, prompt, log
- A dot separates the objects, properties and methods within a statement. Here console is the object and log is a method; document is the object and write is the method; document is the object, getElementById is a method and innerHTML is a property:
- document.write(“Boo! You are NOT the only sentence!”);
- document.getElementById(“demo”).innerHTML = “Hello Dolly”;
A series of pretty good beginner’s exercises: