Can I do the following to concatenate two variables into one? Or there is a better way to do it?
$('.row-add').live("click", function () {
var newContent = $("<span>Example data</span>"+"");
var newContent2 = $("<span>New Project</span>");
var content = newContent+newContent2;
$(this).closest("td").append(content);
});
You can use .add
content = newContent.add( newContent2 );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With