I'm trying to write an if statement where if one of the elements has it's display set to "none", I want the parent element to also display "none"...
This is the code I'm trying, which doesn't work...
/* tried this first */
if($('#prevx a').attr('display') == 'none') {
$(this).parent().attr('display','none');
}
/* and then this */
if($('#prevxa > a').attr('display') == 'none') {
$('#prevxa').attr('display','none');
}
The markup looks like this:
<ul>
<li class="navnext" id="nextxa">
<a id="nextx" href="#"><img src="/images/next.png"/></a>
</li>
<li class="navprev" id="prevxa">
<a id="prevx" href="#" style="display: none;"><img src="/images/previous.png"/></a>
</li>
</ul>