Advertisement
watsoons

JS QEEL

May 1st, 2023
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. function openGroup(evt, groupName) {
  2. // Declare all variables
  3. var i, qeeltabcontent, tablinks;
  4.  
  5. // Get all elements with class="tabcontent" and hide them
  6. tabcontent = document.getElementsByClassName("qeeltabcontent");
  7. for (i = 0; i < tabcontent.length; i++) {
  8. tabcontent[i].style.display = "none";
  9. }
  10.  
  11. // Get all elements with class="tablinks" and remove the class "active"
  12. tablinks = document.getElementsByClassName("tablinks");
  13. for (i = 0; i < tablinks.length; i++) {
  14. tablinks[i].className = tablinks[i].className.replace(" active", "");
  15. }
  16.  
  17. // Show the current tab, and add an "active" class to the button that opened the tab
  18. document.getElementById(groupName).style.display = "block";
  19. evt.currentTarget.className += " active";
  20. }
  21.  
  22. // Get the element with id="defaultOpen" and click on it
  23. document.getElementById("defaultOpen").click();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement