# Simon Game player cannot click on the tile error

**URL:** <https://forum.freecodecamp.org/t/simon-game-player-cannot-click-on-the-tile-error/107649>\
**Category:** General\
**Created:** [April 20, 2017, 12:56am UTC](https://forum.freecodecamp.org/t/simon-game-player-cannot-click-on-the-tile-error/107649 "2017-04-20T00:56:02Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![gmgl21](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/gmgl21/32/118503_2.png) [@gmgl21](https://forum.freecodecamp.org/u/gmgl21)\
**Post date:** [April 20, 2017, 12:56am UTC](https://forum.freecodecamp.org/t/simon-game-player-cannot-click-on-the-tile-error/107649/1 "2017-04-20T00:56:02Z")

</div>

> **[Simon Game](https://codepen.io/glorialee/pen/bWEmRx)**
>
> ...

Please someone help me, I’m having a challenge to debug the Simon Game, nothing happens when the player clicks on the color tile. Am I missing something in the playerMove function or something? Thanks.

---

<div class="post-metadata">

**Author:** ![sceadgugenga](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/sceadgugenga/32/14236_2.png) [@sceadgugenga](https://forum.freecodecamp.org/u/sceadgugenga)\
**Post date:** [April 20, 2017, 1:43am UTC](https://forum.freecodecamp.org/t/simon-game-player-cannot-click-on-the-tile-error/107649/2 "2017-04-20T01:43:20Z")

</div>

Well, I can’t tell you exactly what is wrong, but I can tell you that the click event on your div isn’t being detected.

Also, I don’t think that you need the `onclick` in the html, jquery is handling the events.

---

<div class="post-metadata">

**Author:** ![tommypepsi](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/tommypepsi/32/40130_2.png) [@tommypepsi](https://forum.freecodecamp.org/u/tommypepsi)\
**Post date:** [April 20, 2017, 2:10am UTC](https://forum.freecodecamp.org/t/simon-game-player-cannot-click-on-the-tile-error/107649/3 "2017-04-20T02:10:02Z")

</div>

The problem is in your CSS I don’t know why you put this but in “.tiles” style you have “pointer-events: none;” wich remove all interactions with the element.

---

<div class="post-metadata">

**Author:** ![sceadgugenga](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/sceadgugenga/32/14236_2.png) [@sceadgugenga](https://forum.freecodecamp.org/u/sceadgugenga)\
**Post date:** [April 20, 2017, 2:10am UTC](https://forum.freecodecamp.org/t/simon-game-player-cannot-click-on-the-tile-error/107649/4 "2017-04-20T02:10:29Z")

</div>

It seems to have something to do with `.tiles`. You can test this by creating a click handler on `.game` like so:

```
$('.game').click(function(e){
  console.log(e.target.id)
})

```

The function is passing an event object as a parameter. Whenever an element is clicked, the event object contains the target element. The console log just prints the id of the target element.

If you do this, you will notice that with `.tiles` you get an empty string (because there is no id on the div) when you click on one of the colored tiles. However, if you remove `.tiles` from the class of one of the colored tiles and then click on the tile, the console will log the id of the div.

---

<div class="post-metadata">

**Author:** ![escottalexander](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/escottalexander/32/65992_2.png) [@escottalexander](https://forum.freecodecamp.org/u/escottalexander)\
**Post date:** [April 20, 2017, 2:13am UTC](https://forum.freecodecamp.org/t/simon-game-player-cannot-click-on-the-tile-error/107649/5 "2017-04-20T02:13:19Z")

</div>

TommiPepsi got it! Man, I’ve been playing with it for an hour! Good eye. I didn’t think to check the css. I was looking all over stack overflow for issues with query click event binding. lol

---

<div class="post-metadata">

**Author:** ![tommypepsi](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/tommypepsi/32/40130_2.png) [@tommypepsi](https://forum.freecodecamp.org/u/tommypepsi)\
**Post date:** [April 20, 2017, 2:34am UTC](https://forum.freecodecamp.org/t/simon-game-player-cannot-click-on-the-tile-error/107649/6 "2017-04-20T02:34:45Z")

</div>

I actually just had a similar problem today with my simon game, I had a div inside my tiles to make a beautiful light effect, it was working in chrome but blocking the click in firefox(wich is strange). Adding the “pointer-event:none” to the div inside the tiles fixed it, so it’s the first thing that I saw while looking in his code haha 😁

---

<div class="post-metadata">

**Author:** ![gmgl21](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/gmgl21/32/118503_2.png) [@gmgl21](https://forum.freecodecamp.org/u/gmgl21)\
**Post date:** [April 20, 2017, 6:23am UTC](https://forum.freecodecamp.org/t/simon-game-player-cannot-click-on-the-tile-error/107649/7 "2017-04-20T06:23:38Z")

</div>

Thank you!!! Never would have guessed it was in the css “pointer-events:none” creating the click event function problem. It works now.

> **[Simon Game](https://codepen.io/glorialee/pen/bWEmRx)**
>
> ...

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 17, 2021, 8:53pm UTC](https://forum.freecodecamp.org/t/simon-game-player-cannot-click-on-the-tile-error/107649/8 "2021-01-17T20:53:40Z")

</div>

Closed on January 17, 2021, 8:53pm UTC


