window
variable has lots of nice properties
window.location
window.navigator
window.history
window.screen
window.frames
window.document
-- hey, look! it's the DOMopen()
, close()
moveTo()
, sizeTo()
alert()
, prompt()
, confirm()
setTimeout()
, setInterval()
window
vs. document
document
is the pagewindow
is the stuff around the pagewindow === document
// => false
window.location === document.location
// => true
window
window.location = "http://google.com"
window
window.x = 7;
x === 7; // true
y = 9;
window.y === 9 // works in reverse too
window
parseInt('123') // same
window.parseInt('123') // thing
document.getElementsByTagName('p')[0]
document.getElementById('article')
document.write("<p id='message'>hi</p>"); // :-( this freaks out Firebug Console
var message = document.getElementById('message');
message.innerHTML = "<b>bye</b>!";
let target = document.getElementById('someElement')
let paragraph = document.createElement('p')
paragraph.textContent = "I’ve seen things you people wouldn’t believe. Attack ships on fire off the shoulder of Orion. I watched C-beams glitter in the dark near the Tannhauser gate. All those moments will be lost in time, like tears in rain."
target.appendChild(paragraph)
CSS uses dashes; JavaScript uses camelCase
div.style.backgroundColor = "#FF0000";
return false
submit
event/