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
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
Post a Comment