Le开发者_Python百科ts say I have this code
$(document).ready(function()
{
$('.checkbox').change(function()
{
$('.hidden').slideUp('slow', function()
{
alert(checkbox value);
}
}
}
How do I access the checkboxes value? $(this) doesn't work as you're now in the .hidden element?
You could capture the value in the outer function:
$(document).ready(function() {
$('.checkbox').change(function() {
var $checkbox = $(this);
$('.hidden').slideUp('slow', function() {
alert($checkbox.val());
}
}
}
精彩评论