How can I append a word to an already populated string variable with spaces?
This question is related to
javascript
string
variables
append
Ronal, to answer your question in the comment in my answer above:
function wasClicked(str)
{
return str+' def';
}
var str1 = "add";
str1 = str1 + " ";
Hope that helps,
Dan
var str1 = 'abc';
var str2 = str1+' def'; // str2 is now 'abc def'
Source: Stackoverflow.com