JSFiddle - React, Tailwind, and code Playground

by Aldrin Gauran

HTML

<div id="parent">
    <div id ="child1">
        <div id="subchild1">
            <input type="text" name="first" value="3">
        </div>
    </div>
    <div id ="child2">
        <div id="subchild2">
            <input type="text" name="first" value="7">
        </div>
    </div>
    <div id ="child3">
        <div id="subchild3">
            <input type="text" name="first" value="8">
        </div>
    </div>
</div>
        
 <div id="result">

JavaScript

$(function(){
    var len = $('#parent > div').length;
    
    for(var i=0; i < len; i++){
        var a = $('#subchild'+ [i + 1]).find('input');
        $('#result').html(a);
    }
});