Having the following configuration in my web page
<div class="results_list">
<div class="bg_color shadowy item_wrapper">
<div class="not_shown">some text here...</div>
<div class="social_and_download">
<div class="play_div">
<a class="play" href="#">play</a>
</div>
</div>
</div>
<div class="bg_color shadowy item_wrapper">
<div class="not_shown">other text text here...</div>
<div class="social_and_download">
<div class="play_div">
<a class="play" href="#">play</a>
</div>
</div>
</div>
</div>
, with many div.item_wrapper elements, each having one div.not_shown child, I want to make this visible, by changing its class when clicking the corresponding a.play link . The best I could come up with was :
<script type="text/javascript">
$(document).ready(function() {
$("a.play").click(function () {
$(this).closest("div.item_wrapper").find("div.not_shown").addClass('shown').removeClass('not_shown');
});
});
and it's not working. Could you tell me what I am doing wrong? 10x