Skip to content

Instantly share code, notes, and snippets.

@piatra
Last active December 29, 2015 03:59
Show Gist options
  • Save piatra/7611963 to your computer and use it in GitHub Desktop.
Save piatra/7611963 to your computer and use it in GitHub Desktop.
Demo for working with the chrome dev tools
<html>
<head>
<title>
My webpage
</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>Real time web apps</h1>
</body>
<script src="script.js"></script>
</html>
var body = document.querySelector('body')
function appendElements () {
for (var i = 0; i < 10; i++) {
var p = document.createElement('p')
if (i == 0) p.innerHTML = 'You get a realtime';
else p.innerHTML = 'And you get a realtime';
body.appendChild(p);
}
}
appendElements();
body {
background: #ddd;
}
p {
border-bottom: 1px solid #aaa;
}
li {
background: #81D7E2;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment