JSFiddle - React, Tailwind, and code Playground

HTML

<input id="checked" type="radio" name="radios" value="1" checked="checked" /> 1<br />
<input type="radio" name="radios" value="2" /> 2

<div id="status"></div>

JavaScript

window.setTimeout(function () {
    var checked = document.getElementById('checked'),
        status = document.getElementById('status'),
        fragment = document.createDocumentFragment(),
        radio = document.createElement('input');
    radio.type = 'radio';
    radio.name = 'radios';
    radio.checked = 'checked';
    status.innerHTML += 'Fragment ' + (fragment.parentNode ? ' is in the document tree' : 'has no parent and thus is not in the document tree') + '.<br />';
    status.innerHTML += 'Radio starts ' + (checked.checked ? 'checked' : 'unchecked') + '.<br />';
    fragment.appendChild(radio);
    status.innerHTML += 'Radio ends up ' + (checked.checked ? 'checked! :-)' : 'unchecked :-(');
}, 0);