Open pixelmary opened 4 years ago
Really cool job @Cris-ti-na !!!
Here you have some tips to improve the exercise:
return
statement in a callback to return a value because it's not possible to get the value in the addEventListener
.else
statement.addEventListener
for each event. If you need to execute multiple functions at once perhaps you can call them inside your unique handler..innerHTML
or .value
to get DOM content we receive a string. Sometimes we will need to use something like parseInt()
to convert it to a number.parseInt(value)
within a function it is better set it in a constant.ev.preventDefault()
to prevent page reload.ev.preventDefault()
to first line of the function.===
instead of ==
for comparisons.addEventListener
instead of onClick
to register event listeners.body
, but inside it)../
.div
, p
) and number of trials.label
to define the content of the input.for
attribute of the label and the id
of the input.value
attribute we are indeed setting it to a certain (empty) value, do we want to do that?You are close to the exercise solution, but here you have a steps guide to complete it anyway ;)
Then you can improve the game as you please, here you have some ideas:
Let me know if you have any doubts ;)
Go for it!!
Do not close this issue until your teacher asks you to
@Cris-ti-na ánimo!
Te dejo estos detalles a mejorar: