Skip to content

Instantly share code, notes, and snippets.

@alexstorer
Created February 6, 2013 20:56
Show Gist options
  • Save alexstorer/4725743 to your computer and use it in GitHub Desktop.
Save alexstorer/4725743 to your computer and use it in GitHub Desktop.
Basic demonstration of html and javascript.
<title>Alex's Webpage</title>
<head>
<style>
body
{
background-color:#b0c4de;
}
h1
{
background-color:#123456;
}
div#authorinfo
{
text-align:right;
background-color:#654321;
}
</style>
</head>
<body>
<h1>Hello, World!</h1>
<div id="blogpost">
My dog is brown.
</div>
<div id="authorinfo">
by alex storer
</div>
<div id="blogpost">
I have a dog!
</div>
<div id="authorinfo">
by alex storer
</div>
<div id="message">
</div>
<script>
temp = Math.random();
if (temp > 0.5) {
document.getElementById("message").innerHTML='Have a <b>wonderful</b> day'
}
else {
document.getElementById("message").innerHTML='Have a <b>crap</b> day'
}
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment