Need help to fix an error in a mini-project

I was creating a simple color testing tool with takes hex values and makes the background of the body of that color but unfortunately it is not working as desired. Link to the pen: https://codepen.io/chiragbhansali/pen/zdRZEv. Please tell where am I going wrong.

This line

colorCode = d.querySelector(".color-code").value;

needs to be inside the event handler – otherwise it will always stay at its initial value.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.