We promise not to bombard your inbox. Keep an eye out for promotional offers, discounts and events from On Rope 1.
Use code "OR125" to receive 5% OFF your first order!
document.addEventListener('DOMContentLoaded', function() {
// Check if JS is loaded
console.log('JS Loaded');
// Get the weight method select element
var weightMethodSelect = document.querySelector('.option-weight-method');
var weightValueField = document.querySelector('.option-weight-value');
// Check if the elements are being selected correctly
console.log('Weight Method Select:', weightMethodSelect);
console.log('Weight Value Field:', weightValueField);
// Function to toggle the class based on weight method
function toggleWeightValueField() {
var selectedMethod = weightMethodSelect.value;
console.log('Selected weight method:', selectedMethod);
// If selected method is anything other than 'free', add the class 'display-weight-value-field'
if (selectedMethod !== 'free') {
console.log('Adding class to weight value field');
weightValueField.classList.add('display-weight-value-field');
} else {
console.log('Removing class from weight value field');
weightValueField.classList.remove('display-weight-value-field');
}
}
// Run the function initially to check the default state
toggleWeightValueField();
// Listen for changes on the weight method select and update the field visibility
weightMethodSelect.addEventListener('change', function() {
console.log('Weight method changed!');
toggleWeightValueField();
});
});
Reviews
There are no reviews yet.