код:
<body>
<div class="wrapper">
<div class="card">
<div class="face front">
<h2>Card One</h2>
<button id="frontButton">DETAILS</button>
</div>
<div class="face back">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse non sagittis justo. </p>
<button id="backButton">BACK</button>
</div>
</div>
</div>
<script>
const buttonFace = document.getElementById('frontButton');
buttonFace.addEventListener('click', addFlipped);
const buttonBack = document.getElementById('backButton');
buttonBack.addEventListener('click', removeFlipped);
function addFlipped() {
const elementCard = document.querySelector('.card');
elementCard.classList.add('fliped');
}
function removeFlipped() {
const elementCard = document.querySelector('.card');
elementCard.classList.remove('fliped');
}
</script>
</body>
не могу понять - почему условие не принимается?