Error: Uncaught TypeError: Cannot read property 'style' of undefined. Styles are working when I'm choosing an input. this input:
var input = document.getElementById('pa_rama').value;
var option = document.getElementById('pa_razmer').value;
let ramka = document.getElementsByClassName('woocommerce-product-gallery__image');
if(input == 'chernaya') {
for(var i=0; i < input.length; i++) {
ramka[i].style.border = '50px solid black';
ramka[i].style.boxShadow = 'none';
}
}
What is wrong?