如何在 Javascript 的 for 循环中附加 html 模板? [英] How to append html template inside a for loop in Javascript?
问题描述
我正在尝试动态创建 100 里并在每个里附加一个 html 的模板".最重要的是,我想在该模板中将 id="Increment" 跨度元素动态增加 1,例如... 1, 2, 3 ---> 100
预期效果:http://jsfiddle.net/LQp5y/
当前工作:http://jsfiddle.net/QyWS7/
HTML 标记:
<div class="wrapper"><ul id="currentStore" class="row"><!-- HTML 模板-->
</节>
HTML 模板:
<li><div class="flip-container" ontouchstart="this.classList.toggle('hover');"><div class="flipper"><div class="front"><span>1</span>
<div class="back"><span>购买</span>