Reputation: 2680
For example, <div class="hi_" + "1">
(which doesn't work)
Use case is if I'm templating in handlebars and my code is:
{{#each this}}
<div class="box_" + {{id}}>
{{/each}}
How would I go about naming my divs?
Upvotes: 2
Views: 5358
Reputation: 4413
You can simply insert the placeholder into the class attribute like so:
{{#each this}}
<div class="box_{{ id }}"></div>
{{/each}}
Upvotes: 1