Please don’t post s blob of text as title, it is much more effective if you create a few phrases to explain.
Plus it is impossible to debug from a screenshot, so please post your code in a post or provide a link to something like codepen or repl.it or github (etc) with your code in it