I have a section in which I have multiple images now on click I would like to download all.
Here is what my images look like

and here is how I am downloading those images using jquery
HTML
<button class="button" onclick="downloadImages()">Download</button>
JS
function downloadImages(){
let link = $(".grcode-image");
console.log('link', link)
link.click();
}
When I click the download button only I see is the console log

What am I doing wrong here? and what do I need to do to be able to download all images at once?
uj5u.com熱心網友回復:
如果您只需要下載沒有 zip 的影像:
只需映射陣列并單擊:
function downloadImages() {
$(".grcode-image").each(function (index, currentElement) {
currentElement.click();
});
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/472743.html
標籤:javascript html jquery arrays object
上一篇:Jquery找不到鏈接
下一篇:如何獲取陣列中影像的src和ID
