Script.js line break in a variable quotes = [" (no solution)

Hi. (I’m not familiar with the forums)

I’m really a beginner (and old ha ha ha)
I found some programming that allows me to display random sentences from HTML. The code is fine after some reflections and adaptations I am trying to make a line BREAK in a variable so that the name of the creator of the quote is after the sentence, below.
Q1)
For example and simplified, a sentence:
“So shaken as we are, so wan with care,” Henry announces to his court. Shakespeare"
I would like this:
“So shaken as we are, so wan with care, Henry announces to his court.” (on line return…)
“Shakespeare”

I can’t find…
The code used (which I did not create comes from a codePen site. The script.js gives this and works (in short) but not possible to find a line break

var quotes = [“So shaken as we are, so wan with care,” Henry announces to his court. Shakespeare",

“To be, or not to be: that is the question. Shakespeare”
]; etc. etc.

function getQuote() {
var randomQuote = quotes[Math.floor(Math.random() * quotes.length)];
document.getElementById(“parag”).innerHTML=“” + randomQuote + “”;
}

Q2) How to chage each image on click button?
Thanks

Hi there and welcome to our community!

While we are primarily here to help people with their Free Code Camp progress, we are open to people on other paths, too. Some of what you are asking is pretty trivial in the Free Code Camp context, so you might find that if you’re not getting the instruction and material you need in your current studies, the FCC curriculum will really help you get started. At a modest guess I’d say investing a 4-5 hours working through the curriculum here will really pay off. You can find the curriculum at https://www.freecodecamp.org/learn.

With your current questions, we don’t have enough context to know what you already know or don’t know, so it is impossible to guide you without just telling you the answer (which we won’t do).

It is pretty typical on here for people to share a codepen / repl.it / jsfiddle example of what they have tried so that anyone helping has more of an idea of what help is actually helpful.

Please provide some example of what you’ve tried and I’m sure you’ll get more help.

Happy coding :slight_smile: