document.getElementById()

Post your JavaScript related doubts here! Topics will be visible to your Teaching Assistants and Peers. Your doubts will be solved within 24 hours!

var txt1 = “codes_”;
var txt2 = “cracker”;
document.getElementById(“demo”).innerHTML = txt1 + txt2;

out put?

Hi laxmikumarbilla68732,

var txt1 = "codes_";
var txt2 = "crackers";
document.getElementById('demo').innerHTML = txt1+txt2;

the output will be codes_crackers