我想连续拍摄5张相同的图像(我可以说div吗?)
<body>
<div><img src = "picture.jpg";>
/* code that duplicates or deletes multiple copies of "picture.jpg" */
</div>
</body>
答案 0 :(得分:1)
我会做那样的事情:
<div id="list"><img id="item" src = "picture.jpg"></div>
<script type="text/javascript">
function cloneItem() {
var item = document.getElementById("item");
var list = document.getElementById("list");
var clonedItem = item.cloneNode(true);
list.appendChild(clonedItem);
}
for(var i = 0; i < 5; i++) {
cloneItem();
}
</script>