JSFiddle - React, Tailwind, and code Playground

HTML

<div>
    <input id="z0"/><br/>
    <input id="z1"/><br/>
    <input id="z2"/><br/>
    <input id="z3"/><br/>
    <input id="z4"/><br/>
    <input id="z5"/><br/>
    <input id="z6"/><br/>
</div>
<button id="clicki">click me</button>

JavaScript

function anzeigen() {
    for(i = 0; i <= 6; i++)
    {
        var zaehler = "z" + i ;
        document.getElementById(zaehler).value = "Element " + i;
    }
}

document.getElementById("clicki").addEventListener("click", anzeigen, false);