I tried a small code snippet to hide form div tag and fade in when a checkbox is clicked.
Please have a look at the code
$('checkbox').change(function () {
if ($('[id=vfb-i-would-like-samples-in-24-1]').attr("checked"))
{
alert("test");
$('.vfb-timber-34').fadeIn();
return;
}
$('.vfb-timber-34').fadeOut();
});
But When I use it in the live site its not working. Can someone help me.
Here is the fiddle url
http://jsfiddle.net/addyosmani/ND428/
Here is my site url
http://conceptclick.webande-commercesolutions.com/?page_id=2238
When you go to “I would like samples in” on bottom. there is 3 check-boxes Timber Aluminum and Echo Panel.. When a person clicks Timber that div should fade in.
$('checkbox')will find<checkbox>elements. There’s no such thing, so nothing’s getting the event handler attached to it.Try
$('.checkbox')instead. And thereadything mentioned by Paul wouldn’t hurt either. 🙂