JSFiddle - React, Tailwind, and code Playground
HTML
<input type='text' name='campo1'/>
<input type='text' name='campo2'/>
<input type='text' name='campo3'/>
JavaScript
function setValueInputs(arr){
var inputs = document.getElementsByTagName("input");
for(var i = 0; i<inputs.length; i++){
if(inputs[i].type == "text"){
inputs[i].value = arr[i];
}
}
}
window.onload = function(){
var valores = ["valor1", 123, [12.5, false]];
setValueInputs(valores);
}