Hide css class/button on sites.

How to hide or show class

<script>
   if(window.location.pathname == "/my_url_site/site" || window.location.pathname == "/category/poduct")
	   {
		document.getElementById("myButtonClass").style.visibility = "visible"; 
	   }
</script>

in CSS it is defined in that way:

.myButtonClass{
	background: blue; 
	visibility: hidden;
}

In html code you should declare:

<div class="myButtonClass"> text or something else.. </div>

About the author

Szymon Wójtowicz

Programista C++/Qt. Tworzący aplikacje mobilne i desktopowe.

View all posts

Dodaj komentarz

Twój adres e-mail nie zostanie opublikowany. Wymagane pola są oznaczone *

This site uses Akismet to reduce spam. Learn how your comment data is processed.