So I wanted to do a simple quiz, again inspired by JD. The BF again came up with a super silly idea about what bobby pin you are… Yeah he’s weird, and I like it!
So here is my silly quiz with questions that make absolutely no sense in reference to bobby pins.
- Getting better at using forms and the properties within the form element. This time I used the value property to give each answer a number that will be added to the sum and thereby determining which result the user will get.
- Again practising the show/hide function. I really think it’s a simple way to avoid having to do several pages and linking between them.
- Still trying to get used to the fact that a string with a number in it is not the same as a number. A string with a number cannot be added to another number (in the math sense), but a real number (not a string) can. So the value in the forms are a string, so I needed to change it to a real number. For that I used the parseInt function (that the BF taught me).