Created
November 28, 2012 15:45
-
-
Save raghubetina/4162076 to your computer and use it in GitHub Desktop.
JavaScript Example
This file contains hidden or 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
<h1>Chicago</h1> | |
<h1>San Francisco</h1> | |
<h1>New York</h1> | |
<h1>Boston</h1> | |
<a href="http://www.google.com" id="button">Abracadabra!</a> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> | |
<script> | |
$(document).ready(function() { | |
$("#button").on("click", function() { | |
$("h1").slideToggle(); | |
return false; | |
}); | |
$("h1").on("click", function(e) { | |
alert("You clicked " + e.target.innerHTML); | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment