I have an image on a page and a download button. I would like to click on that download button and the image needs to be downloaded (* It can be in any Format).
Here is my code below for the Image and the download button
<Style>
.results img {
position: absolute;
top: 33%;
left: 25.5%;
width: 50%;
height: auto;
.button img{
position: absolute;
left: 50%;
top: 94.5%;
</style>
<div class="results">
<img src="Images\pic.png">
</div>
<div class="Button">
<input id="test1" name="test1" type="image" src="images/download.png" value="myValue" alt="" onClick=""></div>
Can anyone suggest me a JavaScript solution to achieve this.