Hi, sunny today by -19celcius. I come to warm up here with all your sunshine 🙂
(I'm not familiar with 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 but 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.
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." (and on a return line the rest of the sentence!)
"Shakespeare"
I can't find...
Question 1)
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
Question 2) How to add a new image with this button at each click
Thanks, i appreciate if you can direct me to a website or a way to do it!
(I'm not familiar with 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 but 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.
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." (and on a return line the rest of the sentence!)
"Shakespeare"
I can't find...
Question 1)
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
JavaScript:
var quotes = ["So shaken as we are, so wan with care, Henry announces to his court. Shakespeare",
or something like "So shaken as we are, so wan with care, Henry announces to his court." + "Shakespeare" (i try a \n or <br> dont work!?)
"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="<em>" + randomQuote + "</em>";
}
Question 2) How to add a new image with this button at each click
Thanks, i appreciate if you can direct me to a website or a way to do it!