Wednesday, 21 August 2013

jQuery not sliding correctly

jQuery not sliding correctly

jQuery isn't sliding when the first checkbox is clicked. I believe it is
the correct syntax, but I am not sure. I have looked at it in multiple
browsers, even uploading it to a website. but all to no avail. What is
wrong with my code?
<!DOCTYPE html>
<html>
<title>Test</title>
<head><script
src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
</script>
<script>$(document).ready(function(){
$('#test1').click(function(){
if ($(this).attr('checked')) {
$('#test12').slideUp('fast');
} else {
$('#test12').slideDown('fast');
}
});
});
</script>
</head>
<body>
<h1>form test</h1>
<span><input id="test1" type="checkbox">Hello<br></span>
<span><input id="test12" type="checkbox">Yo</span>
</body>
</html>

No comments:

Post a Comment