title: Change visibility of another element if display none in jQuery
body: <p>I need to change the display property of another element if a specific element has <code>display:none</code>.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>if ($("#first-layer").css('display') === 'none') {
    $("#second-layer").removeAttr("visibility");
  }</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>#second-layer {
    color: black;
    background-color: red;
    width: 200px;
    height: 150px;
    background: yellow;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    margin: auto;
    visibility: hidden; // here I have to change by jQuery
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;header&gt;
    &lt;div id="first-layer"&gt;
      &lt;div id="header-elements"&gt;
        &lt;div id="img-rain" class="animated fadeIn" class="img"&gt;&lt;img src="img/img.png"&gt; &lt;/div&gt;
        &lt;div id="typed-strings" class="text"&gt;
          &lt;span class="animated fadeInUp" id="typed"&gt;&lt;/span&gt;
          &lt;br/&gt;
          &lt;span class="description animated fadeIn"&gt;Your weather in one place&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;div id="typed-strings"&gt;
      &lt;/div&gt;
      &lt;div class="start"&gt;
        &lt;button type="button" class="btn btn-primary btn-lg responsive-width button-                       bg-clr animated fadeIn"&gt;Get Started&lt;/button&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div id="second-layer"&gt;123&lt;/div&gt;
  
  &lt;/header&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I tried solutions from the internet but they didn't work.</p>