Skip to content

Instantly share code, notes, and snippets.

@mklemme
Last active August 29, 2015 14:07
Show Gist options
  • Save mklemme/0ad3e92f15e2125d0e6d to your computer and use it in GitHub Desktop.
Save mklemme/0ad3e92f15e2125d0e6d to your computer and use it in GitHub Desktop.
document
//#document<!DOCTYPE html><html>​…​</html>​<head>​…​</head>​<body>​…​</body>​</html>​
document.head
// <head>​<meta charset=​"utf-8">​<title>​Le DOM playground​</title>​<script src=​"script.js">​</script>​<link rel=​"stylesheet" href=​"styles.css">​</head>​
document.links
// []
document.documentURI
// "file:///Users/Myk/generalAssembly/week1/dom_day_lab/index.html?"
var greeting_h1 = document.getElementById("greeting");
// undefined
greeting_h1
// <h1 id=​"greeting">​Hello there!​</h1>​
greeting_h1.innerText
// "Hello there!"
greeting_h1.innerText = "Hello me"
// "Hello me"
greeting_h1
// <h1 id=​"greeting">​Hello me​</h1>​
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment