JSFiddle - React, Tailwind, and code Playground
by Sergio Kagiema
HTML
<form action="" id="myform_id">
<label for="sergio" id="sergio">Perigrafi</label>
<input name ="sSergio" type="text"/>
<label style="color:red" for="test" id="test"></label>
</form>
JavaScript
//taking labels texts
(function getLabelTxt(){
var html = document.getElementById("sergio").innerHTML;
var hm = document.getElementById("sergio").innerHTML = html.replace(/<[^>]*>/g, "");
//alert(hm);
oFormObject = document.forms['myform_id'];
oFormObject.elements[test].value = hm;
})();
/*http://www.javascript-coder.com/javascript-form/javascript-form-value.phtml*/