Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About dane

  • Rank
  1. Here is my code to create the buttons <?php foreach($array as $x){ if($x !== "0"){ echo('<button class="tablink" onclick="openEvent(event,'. $x . ')">'. "Event ". $x .'</button>'); } } ?> and here is my code to open the tab <script> function openEvent(e, et) { // Declare all variables var i, tabcontent, tablinks; // Get all elements with class="tabcontent" and hide them tabcontent = document.getElementsByClassName("tabcontent"); for (i = 0; i < tabcontent.length; i++) { tabcontent[i].style.display = "none"; } // Get all elemen
  2. Hello I am having some difficulties with my javascript tabs. I used this tutorial to set up my tabs. https://www.w3schools.com/howto/howto_js_tabs.asp For the most part it works but I have a couple of pages that use it with me creating a dynamic amount of tabs. It will works probably 98% of the time. But for some reason some of the tabs will not change the display to block. The div tab with the information is there if I go inspect the page and manually change the display to block. Can anyone help me figure out why this is happening. Thanks
  • Create New...