Skip to content

Instantly share code, notes, and snippets.

@AndrewStanton94
Last active August 29, 2015 14:11
Show Gist options
  • Save AndrewStanton94/6dc607fb1c09db5a624f to your computer and use it in GitHub Desktop.
Save AndrewStanton94/6dc607fb1c09db5a624f to your computer and use it in GitHub Desktop.
Functions and attributes of the document element.
//Atributes
window.screen.width;
window.screen.height;
window.name;
window.location; // URL
window.document.title;
window.document.forms[name]; // Use key to retrieve form
window.document.images[name]; // Use key to retrieve image
// The images width & height attrs are rw-able
//Functions
window.print(); // Open print dialogue
window.document.write(); // Writes to screen. Kills existing content
window.open(URL, name); // URL to open, name of window
// (name not set in chrome if pop up blocker interferes) ! use
prompt(userPrompt); // Returns input from user
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment