Avatar of Brad Dobyns, CSM
Brad Dobyns, CSM
Flag for United States of America

asked on 

Assign DIV style width if "display:none;" in another DIV...

I would like to assign a width value to a div if another div has a "display:none;" style.

Here is what I have so far:
<script type="text/javascript" language="JavaScript">
      function changeWidth()
      {
          if (document.getElementById("quoteCont").style.display = "none")
          {
              document.getElementById("detailAmen").style.width = "100%";
          }
          else
          {
              document.getElementById("detailAmen").style.width = "48%";
          }
      }
      window.onload = function() {
            changeWidth();
      }
</script>

It doesn't seem to work what am I doing wrong?

Thanks Experts,
Brad
JavaScriptCSS

Avatar of undefined
Last Comment
glcummins

8/22/2022 - Mon