JSFiddle - React, Tailwind, and code Playground
by Murali Kaliappan
HTML
<input type="text" name="toTest" placeholder="enter the limit to test case">
<input type="button" value="Submit">
<div id="child">
</div>
<div id="result">
</div>
JavaScript
$("input[type = 'button']").click(function(){
var testNo = $("input[name = 'toTest']").val();
$("#child").empty();
for(var i=0;i<testNo;i++) {
$("#child").append(
"<br> <input type='text' id='size-"+i+"' placeholder='enter the size of the array "+(i+1)+"'/> ");
$("#child").append(
" <input type='text' id='sumToCheck-"+i+"' placeholder='enter the elements of the array "+(i+1)+"'/> <br>");
}
$("#child").append("<br> <button type='submit'> Result </button> <br>");
})
$("button").click(function(){
})