-
-
Save nakajima/e927f7622fa53520959c 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> | |
<title>Checkbox Test</title> | |
<script src="http://code.jquery.com/jquery.js" type="text/javascript"></script> | |
</head> | |
<body> | |
<label> | |
<input type="checkbox" id="box"> Check Me | |
</label> | |
<p> | |
<a href="#test">Is it checked?</a> | |
</p> | |
<script type="text/javascript" charset="utf-8"> | |
$(document).ready(function() { | |
$('a[href="#test"]').live('click', function() { | |
var input = $('input[name="box"]'); | |
if (input.is(':checked')) { | |
alert("Yep.") | |
} else { | |
alert("Nope.") | |
} | |
}); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment