Skip to content

Instantly share code, notes, and snippets.

@creationix
Created June 22, 2011 04:06
Show Gist options
  • Save creationix/1039480 to your computer and use it in GitHub Desktop.
Save creationix/1039480 to your computer and use it in GitHub Desktop.
Simple HTML App template
function Box(width, height) {
this.width = width;
this.height = height;
}
Box.prototype.getArea = function () {
return this.width * this.height;
}
var box = new Box(3, 5);
var area = box.getArea();
document.body.innerText = "The area is " + area;
<!doctype html>
<html>
<head>
<title>Sample Page</title>
<link rel="stylesheet" href="style.css"/>
</head>
<body>
<script src="app.js"></script>
</body>
</html>
body {
color: #faa;
background-color: #333;
font-size: 100px;
text-align: center;
padding: 40px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment