JSFiddle - React, Tailwind, and code Playground

by Nimeshka Srimal

HTML

<div class="image_wrap">
        <img height="100px" width="200px" src="01_eduma.__large_preview.__large_preview.jpg" />
    </div>

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

JavaScript

var img_wrap = $('.image_wrap'),
            src = img_wrap.find('img').attr('src'),
            anchor = $('<a href="' + src + '" download>hello</a>'),
            downloadable_tag = img_wrap.append(anchor);

        console.log(anchor[0]);
        anchor[0].click()