I am currently learning Javascript, and I’d like to create my own Lorem Ipsum generator.
Basically, I would have a list of the paragraphs (in javascript, or in the HTML document?).
When the user presses the Generate button, it would then output 3 random paragraphs from the list.
I’ve looked around on here, but can’t really find anything that helps.
Thanks
You could simply have a Javascript Array and pick a random index and inject that paragraph into the DOM element. I’ve also updated the code to not repeat the previous random integer per your comment below.
Example (code untested)