@Chauhan:

I'm looking at your code again and noticed this section

if (document.querySelector("#"+this.id+">div").getAttribute("class" == "hide") {
   //.....
}

Try this instead

if (document.querySelector("#"+this.id+">div").getAttribute("class") == "hide") {
  //...
}

Probably a typo on your end but you forgot to close the getAttribute's "(rounded brackets)"