lyunm1206 commited on
Commit
def9b3f
·
1 Parent(s): f7219c8
Files changed (1) hide show
  1. script.js +7 -0
script.js CHANGED
@@ -101,6 +101,7 @@ document.addEventListener('DOMContentLoaded', function() {
101
 
102
  function openTab(tabId) {
103
  const tabButtons = document.querySelectorAll('.tab-button');
 
104
 
105
  var i, tabcontent;
106
  tabcontent = document.getElementsByClassName("tab-content");
@@ -113,4 +114,10 @@ function openTab(tabId) {
113
  }
114
  tabButtons.forEach(button => button.classList.remove('active'));
115
  document.querySelector(`.tab-button[data-tab='${tabId}']`).classList.add('active');
 
 
 
 
 
 
116
  }
 
101
 
102
  function openTab(tabId) {
103
  const tabButtons = document.querySelectorAll('.tab-button');
104
+ const allSubOptions = document.querySelectorAll('.tab-content input[type="radio"]');
105
 
106
  var i, tabcontent;
107
  tabcontent = document.getElementsByClassName("tab-content");
 
114
  }
115
  tabButtons.forEach(button => button.classList.remove('active'));
116
  document.querySelector(`.tab-button[data-tab='${tabId}']`).classList.add('active');
117
+
118
+ const firstSubOption = selectedTabContent.querySelector('input[type="radio"]');
119
+ if (firstSubOption) {
120
+ firstSubOption.checked = true; // Set the first sub-option as checked
121
+ updateModels(firstSubOption); // Update the models based on this sub-option
122
+ }
123
  }