Browse Source

Update subject exercise 6 "Bring it to life"

content-update
Marie Malarme 3 years ago committed by Clément
parent
commit
93b38e4ad8
  1. 4
      subjects/bring-it-to-life/README.md

4
subjects/bring-it-to-life/README.md

@ -4,8 +4,8 @@ Still there? Well done! But hold on, here begins the serious part... In order to
[`Link a JS script`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script) to your `bring-it-to-life.html` file. [`Link a JS script`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script) to your `bring-it-to-life.html` file.
In this script, you're going to close the left eye of your entity. In this script, you're going to close the left eye of your entity.
To do so, you have to target the `eye-left` HTML element by its `id` thanks to the [`getElementById`](https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementById) method. Then, change the `style` of your `eye-left` to set its background color to black. We also need to modify its shape ; for that we are going to add a new class to it. To do so, you have to target the `eye-left` HTML element by its `id` thanks to the [`getElementById`](https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementById) method. Then, [change the `style`](https://developer.mozilla.org/en-US/docs/Web/API/ElementCSSInlineStyle/style#setting_styles) of your `eye-left` to set its background color to black. We also need to modify its shape ; for that we are going to add a new class to it.
First, define it in your CSS file: First, define this new class in your CSS file:
``` ```
.eye-closed { .eye-closed {

Loading…
Cancel
Save