Easy there, pal!
To access the Dynamic element styles challenges in the JavaScript basics, you need to sign up and subscribe first.
Cats also have an appreciation for the beautiful. For example, Muffin has a real flair for painting. And he would be particularly grateful if his favorite developer (that’s you!) programmed a small graphics editor for him.
This is how it should work. The canvas where you paint consists of “pixels”, which are actually just empty monospaced div elements. When the user clicks on a “pixel”, it should be filled with a particular color. The color can be selected from the dropdown list next to the canvas. There is also an eraser tool. If the user selects this tool, then the “pixel” that is clicked is filled with white.
pixel class.chosen-color class.eraser class.'white'.To find all the “pixels”, use the querySelectorAllmethod. Use the for ofloop to add the click handler to them. We have already worked with collections and loops in the “Element Collections and Properties” chapter.
You’ve gone to a different page
Click inside the mini-browser to shift the focus onto this window.
To access the Dynamic element styles challenges in the JavaScript basics, you need to sign up and subscribe first.
Have you forgotten your password or lost access to your profile? Enter your email connected to your profile and we will send you a link to restore access.
Forgot to connect your email to the profile? Email us and we’ll help.