Created
September 21, 2011 14:10
-
-
Save mattfawcett/1232125 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<style> | |
.current {color: green;} | |
</style> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function() { | |
$('#things li').click(function(){ | |
$('.current').removeClass('current'); | |
$(this).addClass('current'); | |
}); | |
}); | |
//window.removeEventListener("unload"); | |
</script> | |
</head> | |
<body> | |
<ul id="things"> | |
<li>Thing 1</li> | |
<li>Thing 2</li> | |
<li>Thing 3</li> | |
<li onclick="document.getElementById('things').style.color = 'red';">Thing 4</li> | |
</ul> | |
<a href="http://google.com">Go away</a> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment