0

I have this loop in my Sveltekit template:

{#each Array(nbr_balanced) as balanced, i}
    <div class="row-container" id="row-{i}"></div>
{/each}

Later in the same svelte page I do a api call (this function gets called several times):

async function getDb(sut2) {

           const res = await fetch(`/api/zoe?env=${env}&type=${type}&sut=${sut2}`);
           item = await res.json();

           tc30 = JSON.parse(item.tc30.stdout);
    
           //HERE I WOULD LIKE TO INSERT VALUE OF item.tc30.stdout INTO ABOVE DIV ID:
           // <div class="row-container" id="row-2"></div>   ... How?

How do I insert data/or a value into the specific div id above? (row-{i}, for example row-1, row-2 or row-3 and so on...)

0 Answers0