JSFiddle - React, Tailwind, and code Playground
HTML
<div id="wrapper">
<p>foo</p> <span>bar</span><br>
<input type="text">
<br>
<input type="text">
</div>
<hr>
<button onclick="
alert(document.getElementById('wrapper').innerHTML);
">test</button>
JavaScript
//this is already wrapped by jsfiddle in an onload-function!!
//take it from here.
var elms=document.getElementById('wrapper').getElementsByTagName('input')
, L=elms.length
, F=function(){this.setAttribute('value', this.value);}
;
while(L--)elms[L].onchange=F;