Reputation: 1665
I simply just try to combine two string like:
var temp = "<meta property='og:title' content="; temp += "work1 work2"; temp += "/>";
document.write(temp);
But the result is always:
<meta property='og:title' content=work1 />
But is should be:
<meta property='og:title' content=work1 work2 />
I am new to javascript and any help is appreciated, thanks:-)
Upvotes: 0
Views: 87
Reputation: 1959
Add single quotes for scope content attribut value:
var temp = "<meta property='og:title' content='"; temp += "work1 work2"; temp += "' />";
document.write(temp);
Upvotes: 2