Just need some help here
$(document).ready(
function() {
$('#submitCart').click(function() {
var ListItems = $('.theList').text();
var PriceItems = $('.theList li').attr('data-points');
var GrandTot = $('.totaler').text();
$('#message').text(ListItems + PriceItems + GrandTot);
});
});
So it works, thanks to another post I recently made, I had everything at .html instead of .text, now my problem is when you click the #submitCart
the list comes out like so
item2item2item2 2000 total = $6000
I want the textarea to read like so
Item2 = 2000
Item2 = 2000
Item2 = 2000
Total = $6000
how would I do this? I tried making a <br> inbetween like so, +<br>+ which did not work
Anyone have a good suggestion?
You have some work ahead of you ..
.attronly gets the attribute of the first matched element, and even if it did return all of them you would have to parse before concatenation. Anyway: