Ok basically I want to store part of body tag inside a variable in function and call the function in the body to create that part of the HTML.
Here's my code for the function:
function RadioButtonContent()
{
var rbc = '<h3>Type your radio button here:</h3><input type="text" name="option" id="option" value="Example 1" /><button id="AddButton" onclick="radio()">Add</button><button id="RemoveButton">Remove</button><div id="updateDivRadio"><h1>Space for Radio Button</h1></div>'
var rbcAppen = document.getElementById('radioButton');
rbc.appendChild.rbcAppen;
}
But it doesn't do anything when called... may be DOM doesnt work this way or is there a way around? Here's the fiddle.
Please help
innerHTMLproperty if you're looking to do this.