Satch3000 Satch3000 - 7 months ago 13
Javascript Question

jQuery css() not working with visibility

In the code below I have changed

show()
to
css()
and modified the visibility. For some reason it doesn't show up onclick.

Here is the HTML:

<td class="area">
<img src="/def.jpg" />
</td>

<tr id="target" style="visibility:hidden">
<td>This was hidden</td>
</tr>


and then the jQuery:

$("td.area").on("click", "img", function(){
$("tr:hidden#target").css("visibility","visible");
});

Answer

Why not just use $('tr#target'). See jsFiddle here.