Javascript Button Hover works only once

I’m trying to implement some button which displays list items on hover.

It works good however it stops working after the first hover then I need to keep refreshing the page for it to work again.

Please see the code below;

var btn = document.getElementsByClassName("collapsible"); 
                    btn[0].addEventListener("click", function () { 
                        var content = this.nextElementSibling; 
                        if ( === "block") { 
                   = "none"; 
                        } else { 
                   = "block"; 

Is there anyway I can make it work again and again without having to refresh the page?

67 thoughts on “Javascript Button Hover works only once”

  1. Pingback: viagra connect
  2. Pingback: buy cialis pills
  3. Pingback: sildenafil 20mg
  4. Pingback: cheapest viagra
  5. Pingback: viaga
  6. Pingback: how to take cialis

Leave a Comment