jQuery hide one element based on another element's visibility
I have two DIVs on a page and some jQuery plugin stuff going on. What I need to do is hide element A when element B's visibility is set to none.


Refer this
Below if div A is visible then B will hide and if A is hidden then B will show. You can change the display to none and block for A and refresh the page to see it working
<html xmlns="">
<head id="Head2">
    <script type="text/javascript" src=""></script>
    <script type="text/javascript">
        $(function () {
            if ($("#dvA").is(":hidden")) {
                $("#dvB").css("display", "block");
            } else {
                $("#dvB").css("display", "none");
    <form id="form2">
    <div id = "dvA" style = "display:none">A</div>
    <div id = "dvB">B</div>