from following code i'm creating dynamic anchor tag downloads file. code works in chrome not in ie. how can working
<div id="divcontainer"> <h3>sample title</h3> </div> <button onclick="clicker()">click me</button> <script type="text/javascript"> function clicker() { var anchortag = document.createelement('a'); anchortag.href = "http://cdn1.dailymirror.lk/media/images/finance.jpg"; anchortag.download = "download"; anchortag.click(); var element = document.getelementbyid('divcontainer'); element.appendchild(anchortag); } </script>
internet explorer not presently support download
attribute on a
tags.
see http://caniuse.com/download , http://status.modern.ie/adownloadattribute; latter indicates feature "under consideration" ie12.