From the course: JavaScript: Enhancing the DOM
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Solution: Shapeshifter
From the course: JavaScript: Enhancing the DOM
Solution: Shapeshifter
(upbeat music) - [Narrator] Great job on attempting the Shapeshifter challenge. Let's review a possible solution. As you can see, I'm first selecting the dynamic text, and then I'm altering the style on line 6, 9, 12, and 16. In order to toggle the bold, I'm using an isBold helper value, and I'm setting that to its opposite on line 13. So let's go ahead and press the button. As you can see, all the styles get added and is displayed in a new way. So remember, practicing these methods will make you more proficient in creating dynamic and interactive webpages. It's very normal to not get it right on the first try.
Contents
-
-
-
-
-
-
(Locked)
Changing text and HTML content2m 51s
-
(Locked)
Changing values of input elements4m 35s
-
(Locked)
Manipulating attributes and data attributes2m 1s
-
(Locked)
Working with classes2m 21s
-
(Locked)
Inline styles with JavaScript2m 9s
-
(Locked)
Challenge: Shapeshifter50s
-
(Locked)
Solution: Shapeshifter47s
-
(Locked)
-
-
-
-
-
-