Is this html
<div class='title centered'>SCE</div>
<div class='description'>
Magna tristique pulvinar porta montes, scelerisque
odio montes porta habitasse, ut, arcu scelerisque vel, pellentesque
</div>
I need to fade childer div (description) after clicking on parent (title).
$('.title').click(function() {
$(this).find('.description').fadeOut(fadeTime);
})
What is wrong?
If you have this just once on your page, balalakshmi’s answer will work. If you have more than one, go with this:
Note the use of
next, which looks at the next element at the same level in the dom,instead offindwhich looks for decedents.Finally, if the effect you are really trying to achieve is a toggle on title click, use slideToggle or one of the many fadeToggle plugins.