From b515a87dcb643b0ca623b7806a2e25fedb1f0a76 Mon Sep 17 00:00:00 2001 From: Yixuan Dai <40338102+dyx9@users.noreply.github.com> Date: Tue, 30 Jan 2024 02:37:36 +0000 Subject: [PATCH] fix(curriculum): Update code example for style.display explanation in RPG game (#53440) --- .../62a8e24c673b075317cc0b09.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8e24c673b075317cc0b09.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8e24c673b075317cc0b09.md index dead11d62bc..579ec5c8621 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8e24c673b075317cc0b09.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8e24c673b075317cc0b09.md @@ -7,12 +7,19 @@ dashedName: step-116 # --description-- -The HTML element that shows the monster's stats has been hidden with CSS. Display the `monsterStats` element by updating the `display` property of the `style` property to `block`. For example, updating the `first` property of the `name` property of `user` would look like: +By default, the HTML element that shows the monster's stats has been hidden with CSS. When the player clicks the "Fight dragon" button, the monster's stats should be displayed. You can accomplish this by using the style and display properties on the `monsterStats` element. + +The `style` property is used to access the inline style of an element and the `display` property is used to set the visibility of an element. + +Here is an example of how to update the display for a paragraph element: ```js -user.name.first = "Naomi"; +const paragraph = document.querySelector('p'); +paragraph.style.display = 'block'; ``` +Display the `monsterStats` element by updating the `display` property of the `style` property to `block`. + # --hints-- You should use dot notation to access the `style` property of `monsterStats`.