Performance

Creatine

No items found.
// Wait until the DOM content is fully loaded document.addEventListener("DOMContentLoaded", function() { // Get all radio buttons from 'Collection List - S2' var s2RadioButtons = document.querySelectorAll('.radio3_button_2'); // Get all radio buttons from 'Collection List - S2 Output' var s2OutputRadioButtons = document.querySelectorAll('.radio2_icon'); // Loop through each radio button in 'Collection List - S2' s2RadioButtons.forEach(function(radioButton, index) { // Assign unique IDs to the radio buttons for reference radioButton.id = 's2Radio-' + index; s2OutputRadioButtons[index].id = 's2OutputRadio-' + index; // Add an event listener for when the radio button is clicked/changed radioButton.addEventListener('change', function() { if (radioButton.checked) { // Uncheck all radio buttons in 'Collection List - S2 Output' first s2OutputRadioButtons.forEach(function(outputRadio) { outputRadio.checked = false; }); // Select the corresponding radio button in 'Collection List - S2 Output' var targetRadio = document.getElementById('s2OutputRadio-' + index); if (targetRadio) { targetRadio.checked = true; } } }); }); });