Skip to content

Instantly share code, notes, and snippets.

@seykron
Created September 14, 2013 23:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seykron/6566779 to your computer and use it in GitHub Desktop.
Save seykron/6566779 to your computer and use it in GitHub Desktop.
Test for bindings between JavaScript, DOM and CSS.
<!DOCTYPE html>
<html>
<head>
<title>DOM Binding Test</title>
</head>
<body>
<button id="action">Submit!</button>
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function (event) {
var button = document.getElementById("action");
button.addEventListener("click", function (event) {
button.style.backgroundColor = "#000000";
button.style.color = "#ffffff";
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment