I am running a flask app, and using a plugin named "Autoindex" for listing all the files in a directory, like this Now, when i click on an image name, it opens the image. But I want to downlaod the image without leaving the page on button click.
I cannot modify the HTML
code of this. So I was thinking, can i use Javascript to perform this task?
EDIT
This is the HTML CODE:
<td class="name">
<a href="/templete/images/2.jpg">2.jpg</a></td>
<td class="modified">
<time datetime="2019-07-15 15:42:20.989829">2019-07-15 15:42:20.989829</time>
</td>
<td class="size">
Now, I cannot modify the HTML Code directly. The link has no class, how can I change this
<a href="/templete/images/2.jpg">2.jpg</a>
to this, for all image links in the page.
<a href="" download="/templete/images/2.jpg">2.jpg</a>