Creating RadioButton in Front end (PHP)
<p>Good Day!</p>

<p>What I want is that I am having 3 radio buttons and a button in the end which is clicked to create new radio button where user enters label and value and check/uncheck himself.</p>

<p>I a trying below code :</p>

<p>JS:</p>

<pre><code>function createRadioElement( name, checked ) {
var radioInput;
try {
    var radioHtml = '&lt;input type="radio" name="' + name + '"';
    if ( checked ) {
        radioHtml += ' checked="checked"';
    }
    radioHtml += '/&gt;';
    radioInput = document.createElement(radioHtml);
} catch( err ) {
    radioInput = document.createElement('input');
    radioInput.setAttribute('type', 'radio');
    radioInput.setAttribute('name', name);
    if ( checked ) {
        radioInput.setAttribute('checked', 'checked');
    }
}

return radioInput;
}
</code></pre>

<p>In Div:</p>

<pre><code>&lt;input type="button" name="create" value="Create New Equipment" onclick="javascript:createRadioElement();"&gt;&lt;/label&gt;&lt;br /&gt;
</code></pre>

<p>It is created in my div named form_div</p>

<p>Please Guide</p>

<p>Thanks</p>