jeremyll
asked on
Jquery: remove div X if div Y does not exist
I would like to use Jquery to remove div X if div Y does not exist
The jquery below doesnt' work,
$(function () {
if ($("#ctl03_LeftNav").lengt h == 0) {
$("#left_container").remov e();
)
});
The jquery below doesnt' work,
$(function () {
if ($("#ctl03_LeftNav").lengt
$("#left_container").remov
)
});
<div id="content_container">
<div id="left_container">
<!-- <div id="ctl03_LeftNav">-->
<!-- Empty white space -->
<!--</div>-->
</div>
<div class="right_container" id="ctl03_right_container">
<div class="content">
</div>
</div>
</div>
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Huh, wierd. I must have inadvertently fixed that when I tested the code. Well done Chris.