<input id="txtBox" type="text"/>
<span> <input id="txtBox" type="text"/> <span>エラーです</span> </span>
var txtBox = document.getElementById('txtBox'); var span = document.createElement('span'); var parent = txtBox.parentNode; parent.replaceChild( span, txtBox); span.appendChild( txtBox ); var errTips = document.createElement('span'); span.appendChild(errTips); errTips.innerHTML = 'エラーです';