I am wondering how do i put a "next line" for a variable that has multiple items in Javascript. Do i put \ or \n or \r\n or an html line break in this line?
This is the code:
var html = "Title : " + data[i].title + " description \r\n : " + data[i].description + "\n";
var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
ctx.rect(20,(rectSize+100)*i,250,80);
ctx.fillText(html, 20,(rectSize+120)*i);
ctx.stroke();
I am trying to put 2 items in a variable that is going through a loop and i want the items to be in different lines. Or do i have to assign different variables to each item?