You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make a note of this. You should **always** use it or else your bindings won't work and the functions will run when you are loading the page.
151
+
Make a note of this. Wrapping your event listeners and other code within this make's sure they are executed only after all the DOM elements are loaded and ready. You should **always** use it or else your bindings won't work and the functions will run when you are loading the page.
152
152
153
153
#Exercise 1: Build a wish list
154
154
@@ -380,7 +380,7 @@ Set `.preview`'s background color, to the random color code.
380
380
381
381
###Restrict number of displayed boxes
382
382
383
-
We only want to be able to add 16 colors to our favorite list. To do that, we can update the code handling the **click** event and check that the length of `$("#colors .item")` is **equal** than 16. If it's not, remove the last element.
383
+
We only want to be able to add 16 colors to our favorite list. To do that, we can update the code handling the **click** event and check that the length of `$("#colors .item")` is **less** than 16. If it's not, remove the last element.
384
384
385
385
This way, when the list is full, we remove a box and add another one.
0 commit comments