I want to create multiple elements having the same class with jade. Is this possible? It should be something like this:
3 times do
insert div.className
Thank you in advance!
Multiple elements can share a single class without issue, just as in standard HTML. That's one of the underlying differences between a class and ID, though there is some other differentiation.
An easy way to do this is using a traditional JavaScript for-loop incorporated into your Jade template.
- for(var x = 0;X < 3;x++)
.nameOfClass
or (obviously)
- for(var x = 1;x <= 3;x++)
.nameOfClass
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With