I have a JS variable like this
totalItems = 'TOTAL ITEMS';
if(rck > 0)
totalItems = totalItems+" \nRack(s) "+rck;
if(totflat > 0)
totalItems = totalItems+" \nFlat Shelf(s) "+totflat;
if(db > 0)
totalItems = totalItems+" \nDisplay bar(s) "+db;
if(totslan > 0)
totalItems = totalItems+" \nSlanted shelf(s) "+totslan;
document.getElementById('totalitems').innerHTML = totalItems;
Here totalitems is my <div> id in HTML form.
The text is printing in a single line, but I want them in each line like
TOTALITEMS
Rack(s) 2
Flat Shelf(s) 2
...
How to do this? And my other question is I need to send that text in the same format to my PHP file. How to post the text from div to PHP? Any advices??? Thank you