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 -

Python Tornado package error when running server -

Qt QGraphicsScene is not accessable from QGraphicsView (on Qt 5.6.1) -