document.addEventListener("DOMContentLoaded", function() {
// Check if the #size element exists
var selectElement = document.querySelector('#size');
if (selectElement) {
// Apply the initial styles to the select element
selectElement.style.backgroundColor = 'black';
selectElement.style.color = '#DA8900';
selectElement.style.border = '2px solid #DA8900';
selectElement.style.padding = '5px';
selectElement.style.fontSize = '16px';
selectElement.style.appearance = 'none';
}
// Check if the option elements exist within the select dropdown
var options = selectElement.querySelectorAll('option');
if (options.length > 0) {
options.forEach(function(option) {
option.style.backgroundColor = 'black';
option.style.color = '#DA8900';
});
// Apply hover effect on the options
options.forEach(function(option) {
option.addEventListener('mouseenter', function() {
option.style.backgroundColor = '#DA8900';
option.style.color = 'black';
});
option.addEventListener('mouseleave', function() {
option.style.backgroundColor = 'black';
option.style.color = '#DA8900';
});
});
}
});