I am trying to create html elements dynamically using javascript. For example, when creating a paragraph in my "finalXML" file, I use the syntax below:
function paragraph (finalXML, value)
{
var code1 = 'var para = document.createElement("p");
var t = document.createTextNode("This is the paragraph that should be displayed");
para.appendChild(t);
document.body.appendChild(para);'
return String(finalXML).replace(/add_paragraph_here/g,code1);
}
How would I go about creating a div with radio buttons, for example, using the same process? Can anyone help me with that syntax?