Skip to content

Instantly share code, notes, and snippets.

@michalbe
Created October 30, 2014 00:11
Show Gist options
  • Save michalbe/75b2bca73591be8a91b4 to your computer and use it in GitHub Desktop.
Save michalbe/75b2bca73591be8a91b4 to your computer and use it in GitHub Desktop.
Events test
<!DOCTYPE HTML>
<html>
<head>
<style>
div {
background-color: #f0f;
width: 300px;
height: 300px;
}
</style>
</head>
<body>
<a href="http://localhost:8080/ip/nestle-bottled-spring-water-1-2-liter-16-9-oz-24-bottles-pack/182653">
<div id="test"></div>
</a>
<script>
var test = document.getElementById('test');
test.addEventListener('click', function(){
test.style.backgroundColor = "green"
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment