Skip to content

Instantly share code, notes, and snippets.

@seanhess
Created October 20, 2012 02:03
Show Gist options
  • Save seanhess/3921701 to your computer and use it in GitHub Desktop.
Save seanhess/3921701 to your computer and use it in GitHub Desktop.
Example.html
<html>
<head>
<style>
button {
width: 400px;
}
.bob {
background-color: blue;
}
</style>
<script>
function doSomethingWhenYouClickAButton(name) {
console.log("HELLO")
console.log("Hi " + name)
var items = document.getElementById("items")
console.log(items.innerHTML)
items.innerHTML = items.innerHTML + "<div>" + name + "</div>"
console.log("HUH", items.innerHTML)
}
</script>
</head>
<body>
<h1>Hello</h1>
<button class="bob">Hello</button>
<button onclick="doSomethingWhenYouClickAButton('Sean')">Sean</button>
<button onclick="doSomethingWhenYouClickAButton('Ty')">Ty</button>
<button onclick="doSomethingWhenYouClickAButton('Lee')">Lee</button>
<div class="bob">lkjdsfjkllkjfds</div>
<a href="http://google.com">Google</a>
<input value="value">
<div id="items">
hello?
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment