I am trying to learn jQuery with the following script. For this, I tried the following jQuery after reading a few SO questions; but it did not work
$(this).closest('.viewLogText').parent().find('.reportLog').css("display", "none");
Scenario:
There are three div children in a div that have the "repeataterRecord" CSS class. The child divs use the css classes - repeataterIdentifier, viewLogTitle and reportLog.
There are two divs in this structure (a div that has the "repaterRecord" Css class).

The div class with the viewLog class is shown below.
<div class="viewLogTitle"> <div class="viewLogText"> View Report Log </div> <div> <img alt="Expand" src="Images/PlusIcon.GIF" class="expandLogIcon" /> <img alt="Collapse" src="Images/MinusIcon.GIF" class="collapseLogIcon" /> </div> </div>
When I click on the collapseLogIcon image, I need to hide (only) the closest div with the class "reportLog" (at the same level as "viewLogTitle"). How can we do this with jQuery?
Updated working example :
http://jsfiddle.net/Lijo/L9w4F/11/ and http://jsfiddle.net/Lijo/L9w4F/8/ and http://jsfiddle.net/Lijo/L9w4F/12/
REFERENCE :
source share