@@ -663,8 +663,10 @@ Your _quest_ is to turn this **`0`** into a **`1`**.
663
663
Given the ** ` JSDOC ` ** comment and _ test_ above,
664
664
take a moment to think of how _ you_ would write
665
665
the ` add_attributes ` function to apply a CSS ` class ` to an element. <br />
666
- Note: we have _ seen_ the code _ before_ in the ` counter ` example.
667
- The difference is this time we want it to be "generic";
666
+
667
+ > ** Note 0** : we have "_ seen_ " the code _ before_ in the ` counter ` example:
668
+ >
669
+ > The difference is this time we want it to be "generic";
668
670
we want to apply a CSS ` class ` to _ any_ DOM node.
669
671
670
672
If you can, make the test _ pass_
@@ -703,7 +705,7 @@ Once you make the test _pass_ you _should_ see the following in your Terminal:
703
705
704
706
The ` <input> ` form element (_ where we create new Todo List items_ )
705
707
has a helpful ` placeholder ` attribute _ prompting_ us with a question:
706
- "_ What needs to be done?_ "
708
+ "*** What needs to be done?*** "
707
709
708
710
Add the following test to the ` test/elmish.test.js ` file: <br />
709
711
@@ -721,15 +723,22 @@ test('elmish.add_attributes set placeholder on <input> element', function (t) {
721
723
});
722
724
```
723
725
726
+ _ Run_ the test ` node test/elmish.test.js ` :
724
727
728
+ ![ image] ( https://user-images.githubusercontent.com/194400/43416801-34e48d2c-9431-11e8-8786-7676f9e3972f.png )
725
729
730
+ You _ know_ "the drill"; write the necessary code
731
+ in the ` add_attributes ` function of ` elmish.js `
732
+ to add a ` placeholder ` to an ` <input> ` element
733
+ and make this test _ pass_ :
726
734
727
- Write the necessary code in the ` add_attributes ` function of ` elmish.js `
728
- to make this test _ pass_ .
735
+ ![ image] ( https://user-images.githubusercontent.com/194400/43416921-8506baaa-9431-11e8-9585-814e704a694d.png )
729
736
730
737
If you get "stuck", checkout the _ complete_ example:
731
738
[ /examples/todo-list/elmish.js] ( https://github.com/dwyl/learn-elm-architecture-in-javascript/tree/master/examples/todo-list/elmish.js )
732
739
740
+ <br />
741
+
733
742
734
743
#### Input ` autofocus `
735
744
0 commit comments