im relatively new to coding and im not sure whats going on , i added an event listner to a button which suppose to show another element by adding a new class but its not working , can anybody advise whats wrong with my code , thank you
//selecting all required elements
const start = document.querySelector(".start");
const startBtn = start.querySelector(".start__button");
const instructions = document.querySelector(".instructions");
const exitBtn = instructions.querySelector(".instructions__quit");
const continueBtn = instructions.querySelector(".instructions__proceed");
// if start button clicked
startBtn.addEventListener("click", function(){
instructions.classList.add(".showinstructions"); //show instructions
});
.instructions {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2),
0 6px 20px 0 rgba(0, 0, 0, 0.19);
width: 5.4rem;
background: #fff;
border-radius: 5px;
transform: translate(-50%, -50%) scale(0.9);
opacity: 0;
pointer-events: none;
transition: all 0.3s ease;
.showinstructions {
opacity: 1;
z-index: 5;
pointer-events: auto;
transform: translate(-50%, -50%) scale(1);
}
<body>
<!-- start Test button -->
<div class="start">
<p class='start__paragraph'>Click Below to start the test</p>
<button class='start__button'>Start Test</button>
</div>
<!-- Instructions -->
<div class="instructions">
<div class="instructions__title">
<span>Rules of the test.</span>
</div>
<div class="instructions__list">