title: Hide bootstrap alert if empty don´t work
body: <p>I want to hide my bootstrap alert if it is empty. It hide correctly when page load, problem is when I do a push who insert data into div, it don´t show alert and it keep with <code>display = none</code></p>
  
  <p><a href="https://i.stack.imgur.com/7VNZW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7VNZW.png" alt="enter image description here"></a></p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code> &lt;div id="a1" class="alert alert-success"&gt;
                  &lt;div id="discussion"&gt;&lt;/div&gt;
              &lt;/div&gt;
  </code></pre>
  
  <p><strong>JS:</strong></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      hideAlert("a1");
  
      function hideAlert(id) {
          var text = $('#' + id + '#discussion').text();
          console.log(text.length);
          if (text.length &lt;= 0)
              $('#' + id).hide();
      }
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>Edit</strong></p>
  
  <p>I try it using <code>input event</code> , it occurs same. It hide but it don't show when get value</p>
  
  <p><strong>JS:</strong></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $('#discussion').keyup(function () {
  
          // If value is not empty
          if ($(this).val().length == 0) {
              // Hide the element
              $('#a1').hide();
          } else {
              // Otherwise show it
              $('#a1').show();
          }
      }).keyup();
  
  
  &lt;/script&gt;
  </code></pre>