Hey I am trying to concatenate strings with javascript but I am having errors. Here is my code:
function popForm(){
var v = document.getElementById('a1').innerHTML;
document.getElementById("a1_i").innerHTML =
"<input type='text' name='a1_i' value="+v+" />";
}
The element a1_i is a span that I am populating with the input tag shown above.
Further down I edit the element with ID a1:
document.getElementById("a1").innerHTML="blah bloop";
However when I try to view the result, all I can see is blah, not bloop.
Any suggestions?
createElementandappendChildto build HTML, not string concatenation.