I'm having an issue with my event listener for a button that is supposed to change the css of #popUpForm. It seems to only work when I add inline css directly to #popUpForm. Is there a way to achieve this without using inline css and instead setting the display property in the css file?
const addBtn = document.querySelector('#addItem')
addBtn.addEventListener('click', function() {
document.querySelector('#popUpForm').style.display = 'block'
})
#popUpForm {
width: 350px;
height: 500px;
display: none; /* change this */
}
<input id="addItem" type="button" value="+">
<div id="popUpForm">
Some stuff
</div>