Review Algorithmic Thinking by Building a Dice Game - Step 2

Tell us what’s happening:

Task is to set up the Hide Rules/ShowRules mechanic.What is wrong?

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

 document.addEventListener("click",((rulesBtn)=>{
 rulesContainer.visibility=true;
 if(clickCount%2===1){isModelShowing=true;rulesBtn.textContent="Hide rules"}else{isModelShowing=false;rulesBtn.textContent="Show rules"}}))

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36 Edg/142.0.0.0

Challenge Information:

Review Algorithmic Thinking by Building a Dice Game - Step 2

Hi @zm17jaga

Syntax highlighting is giving you some information.

You’ll need to fix those typos first.

Happy coding

document.addEventListener("click",((rulesBtn)=>{
 rulesContainer.visibility=true;
 if(clickCount%2===1){const isModelShowing=true;rulesBtn.textContent="Hide rules"; rulesContainer.style.display=false}else{const isModelShowing=false;rulesContainer.style.display=false;rulesBtn.textContent="Show rules"}})) 

Still not working

you may want to use isModalShowing to check if it’s showing or not. clickCount is not contemplated by the tests

document.addEventListener(“click”,((rulesBtn)=>{

rulesContainer.visibility=true;

if(isModelShowing){rulesBtn.textContent=“Hide rules”; rulesContainer.style.display=false}else{rulesContainer.style.display=false;rulesBtn.textContent=“Show rules”}})) ```

Still not working