# Js dom little bug

**URL:** <https://forum.freecodecamp.org/t/js-dom-little-bug/202407>\
**Category:** I Built This\
**Created:** [June 21, 2018, 7:41pm UTC](https://forum.freecodecamp.org/t/js-dom-little-bug/202407 "2018-06-21T19:41:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![coderharshit](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/coderharshit/32/89330_2.png) [@coderharshit](https://forum.freecodecamp.org/u/coderharshit)\
**Post date:** [June 21, 2018, 7:41pm UTC](https://forum.freecodecamp.org/t/js-dom-little-bug/202407/1 "2018-06-21T19:41:20Z")

</div>

what is happening i am comparing two colours and even if they are same the result is wrong help me find the bug please.

> **[rgba Color Guessing Game](https://codepen.io/harshitsan/pen/BVxKRR)**
>
> Guess the rgba colours. it have 2 mode easy and hard....

---

<div class="post-metadata">

**Author:** ![BenGitter](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/bengitter/32/12192_2.png) [@BenGitter](https://forum.freecodecamp.org/u/BenGitter)\
**Post date:** [June 21, 2018, 8:03pm UTC](https://forum.freecodecamp.org/t/js-dom-little-bug/202407/2 "2018-06-21T20:03:35Z")

</div>

`selectedColor` is something like `rgb(255, 0, 0)` while `requiredColor` is in the format `rgb(255,0,0)`. Note that one has whitespace after the commas, while the other has not.

---

<div class="post-metadata">

**Author:** ![coderharshit](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/coderharshit/32/89330_2.png) [@coderharshit](https://forum.freecodecamp.org/u/coderharshit)\
**Post date:** [June 21, 2018, 8:08pm UTC](https://forum.freecodecamp.org/t/js-dom-little-bug/202407/3 "2018-06-21T20:08:25Z")

</div>

thank you so much 😄 spend a lot of time finding this

---

<div class="post-metadata">

**Author:** ![coderharshit](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/coderharshit/32/89330_2.png) [@coderharshit](https://forum.freecodecamp.org/u/coderharshit)\
**Post date:** [June 21, 2018, 8:09pm UTC](https://forum.freecodecamp.org/t/js-dom-little-bug/202407/5 "2018-06-21T20:09:40Z")

</div>

yes, i got it now 🙄

---

<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, 7:48pm UTC](https://forum.freecodecamp.org/t/js-dom-little-bug/202407/6 "2021-01-17T19:48:11Z")

</div>

Closed on January 17, 2021, 7:48pm UTC


