Just two switches:
<input type="radio" name="r" value="1" onclick="check()">Даты неизвестны<br> <input type="radio" name="r" value="2" onclick="check()"><span>Даты известны<span> <div id="div1"></div> By default, nothing is selected, when we select the second one, then we add input fields (up to here did it ourselves):
function check() { var inp = document.getElementsByName('r'); for (var i = 0; i < inp.length; i++) { if (inp[i].type == "radio" && inp[i].checked) { if (inp[i].value == 1) { document.getElementsByName('text1').disabled = true; } if (inp[i].value == 2) { document.getElementById('div1').innerHTML = '<input type="date" name="d1" ><input type="date" name="d2" >'; } } } } But "type was wrong and change the choice" - the added field does not disappear. An attempt to make it inactive does not lead to anything (this is enough). How to get html from js ? How to remove added "by mistake" field?