javascript - Show bootstrap alert when have content -


i want display bootstrap alert when have content

it content when push, if doesn't have content want see like

enter image description here

code:

 <div class="alert alert-success">                 <ul id="discussion"></ul>             </div> 

how can hide if <ul id="discussion"></ul> empty? regards

use below javascript @ bottom of page:

window.onload = function(){   var doc = document.getelementbyid('discussion').textcontent;   if(doc == '')      document.getelementbyid('discussion').parentnode.style.display = 'none'; } 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -