I have been tackling the Rock Paper Scissors project from The Odin Project.
Take a look at the interface I have developed so far:
My goal is to display the results on new lines every time a button is clicked.
- Instead, they are appearing next to each other on the same line.
I have attempted various strategies:
- Adding \n at the end and/or beginning of each answer string (unsuccessful); manipulating the DOM to create new 'p' element or 'br' element, storing it in a constant variable called 'newLine', and appending as " + newLine" after each string (resulted in [HTMLElementp or HTMLElementbr] displaying in the browser); adding each answer as a new list item (did not work).
What do I need to do to make them appear on separate lines?
You can view the code here: https://github.com/Catito1990/RockPaperScissors/blob/main/javascript.js. There are additional elements that I haven't had the chance to work with yet because I've been stuck on this issue for 2 days.
Appreciate any help!