I am playing with Pyscript for the first time and I am trying to create a DOM element for each element in an array, similar to the *ngFor directive in Angular. Is there any way to achieve this?
<body>
<div id="test"></div>
<py-script>
dataSet = [1,2,3,4]
for i,x in enumerate(dataSet):
pyscript.write("test", x)
</py-script>
</body>
To append a new DOM element, use the
append=TrueparameterThe signature for pyscript.write
Source for
pyscript.writelink