Skip to content

Instantly share code, notes, and snippets.

@generalredneck
Created September 18, 2012 18:39
Show Gist options
  • Save generalredneck/3744942 to your computer and use it in GitHub Desktop.
Save generalredneck/3744942 to your computer and use it in GitHub Desktop.
simple test
<html>
<head>
<style>
div.product {
height:100px;
width:100px;
border: 1px solid black;
background-color:yellow;
float:left;
}
</style>
<script src="jquery-1.8.1.min.js"></script>
<script type='text/javascript'>
$(document).ready(function(){
$(".product").click(function(){
$(this).css("background-color","red");
});
});
</script>
</head>
<body>
<div id="product-1" class='product'>&nbsp;</div>
<div id="product-2" class='product'>&nbsp;</div>
<div id="product-3" class='product'>&nbsp;</div>
<div id="product-4" class='product'>&nbsp;</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment