I have a unique situation with two input elements and a button:
<input class="close-acc-usr opt-in" type="text" name="closeAccUsr" />
<input class="close-acc-pin opt-in" type="number" name="closeAccPin" />
<button class="opt-btn close-btn">→</button>
When I click the button, I want both input elements to clear. I tried using this code in the JS event handler function:
document.querySelector('.opt-in').value = '';
However, this code doesn't work as expected. Interestingly, when I replace '.opt-in' with '.close-acc-pin' or '.close-acc-usr', it works perfectly fine. Why does it not work with '.opt-in'?