document.querySelectorAll('.form-select')[0].addEventListener('input', function(e){
var value = e.currentTarget.value; // function(e)에서 e제거후 this.value도 가능
if(value == '셔츠') {
document.querySelectorAll('.form-select')[1].classList.remove('form-hide');
}
else if(value == '바지'){
document.querySelectorAll('.form-select')[1].classList.remove('form-hide');
document.querySelectorAll('.form-select')[1].innerHTML='';
var a = `<option>28</option><option>30</option>`;
document.querySelectorAll('form-select')[1].insertAdjacentHTML('beforeend', a);
}
});
코드인데요 셔츠를 눌렀다가 바지를 선택하면 안의 html이 지워지긴 하는데
옵션 28이랑 30이 안나오고 그냥 공백인채로 나옵니다.. 뭐가 문제일까요?