So I'm doing a quote generator in Javascript in which the quote generates on click.
The code looks like this:
$("#getQuote").on("click", function(){
var i = Math.floor((Math.random() * quote.length));
$("#theQuote").html(quote[i] <\br> person[i]);
});
I'm trying to make a line break between the quote and the person who made the quote but it doesn't seem the recognize any code after quote[i]
.
I've also tried adding \n
to the strings in my array for example:
var quote = ['"With great power, comes great responsibility." \n- Uncle Ben'];
but somehow \n
is not read whereas the rest of the quote is.
` instead of `<\br>` – Parag Jadhav Jun 07 '17 at 04:58
person[i]);` to `$("#theQuote").html(quote[i] +'
'+ person[i]);` – XYZ Jun 07 '17 at 04:59
` instead of `<\br>`? – Orifjon Jun 07 '17 at 05:00