Hide element when another element is present on the page

Rate this post

I want to hide an element if one element is already present on the page.

If element with the id:


is present on the page, then hide following element:


I want to achieve is either through a function or .css, it doesn’t matter.



Just do it with JavaScript.

var element = document.getElementById('wcfmmp_store_about');

if (typeof(element) != 'undefined' && element != null)
} else {
.left_sidebar.sidebar_hidden {
  display: none 

Leave a Reply

Your email address will not be published.

Back to top button