|
|
Line 32: |
Line 32: |
| </style> | | </style> |
|
| |
|
| <script>
| |
| // Function to switch to the previous tab
| |
| function switchToPreviousTab() {
| |
| var activeTab = document.querySelector(".frmTab.active");
| |
| var previousTab;
| |
|
| |
|
| // Find the previous tab
| |
| if (activeTab.previousElementSibling) {
| |
| previousTab = activeTab.previousElementSibling;
| |
| } else {
| |
| // If the current tab is the first one, go to the last tab
| |
| previousTab = activeTab.parentElement.lastElementChild;
| |
| }
| |
|
| |
| // Trigger click event on the previous tab
| |
| previousTab.click();
| |
| }
| |
|
| |
| // Function to switch to the next tab
| |
| function switchToNextTab() {
| |
| var activeTab = document.querySelector(".frmTab.active");
| |
| var nextTab;
| |
|
| |
| // Find the next tab
| |
| if (activeTab.nextElementSibling) {
| |
| nextTab = activeTab.nextElementSibling;
| |
| } else {
| |
| // If the current tab is the last one, loop back to the first tab
| |
| nextTab = activeTab.parentElement.firstElementChild;
| |
| }
| |
|
| |
| // Trigger click event on the next tab
| |
| nextTab.click();
| |
| }
| |
|
| |
| </script>
| |
|
| |
|
| <div id="tabButtons"> | | <div id="tabButtons"> |
|
| |
|
| <!-- Next Tab Button --> | | <!-- Next Tab Button --> |
| <button id="nextTabButton" onclick="switchToNextTab()">Next Tab</button> | | <button id="nextTabButton" onclick="openTab(event, 'frmTabww')">Next Tab</button> |
| <div class="spacer"></div> | | <div class="spacer"></div> |
| <!-- Previous Tab Button --> | | <!-- Previous Tab Button --> |
| <button id="previousTabButton" onclick="switchToPreviousTab()">Previous Tab</button> | | <button id="previousTabButton" onclick="openTab(event, 'frmTabeoe')">Previous Tab</button> |
| </div> | | </div> |
| </html> | | </html> |