I'm trying to generate multiple canvas and draw on them in loop.
When I execute the code all canvas generate properly, but only the last one have rectangle on it.
for(var i = 0; i < canvasNumber; i++) {
$(".canvas-container")[0].innerHTML += `<canvas class="canva${i}"></canvas>`;
$(`.canva${i}`)[0].width = window.innerWidth/5;
$(`.canva${i}`)[0].height = window.innerHeight/5;
let cc = $(`.canva${i}`)[0].getContext("2d");
cc.fillRect(30*i,20,200,100);
}