# Ipfs Download Button

**URL:** <https://discuss.ipfs.tech/t/ipfs-download-button/2329>\
**Category:** Help\
**Tags:** js-ipfs\
**Created:** [March 16, 2018, 12:57pm UTC](https://discuss.ipfs.tech/t/ipfs-download-button/2329 "2018-03-16T12:57:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cheerio](https://avatars.discourse-cdn.com/v4/letter/c/90db22/32.png) [@Cheerio](https://discuss.ipfs.tech/u/Cheerio)\
**Post date:** [March 16, 2018, 12:57pm UTC](https://discuss.ipfs.tech/t/ipfs-download-button/2329/1 "2018-03-16T12:57:15Z")

</div>

Hi,

I would like to integrate an ipfs download button into a html file, but I am not sure how to do that.

Aim:  
Button opens new tab in browser with a linked file, so the button should not be static but should take [https://ipfs.io/ipfs/](https://ipfs.io/ipfs/) + (input hash).

Can someone provide me with an example?

Kind regards  
Cheerio

---

<div class="post-metadata">

**Author:** ![josselinchevalay](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/josselinchevalay/32/3078_2.png) [@josselinchevalay](https://discuss.ipfs.tech/u/josselinchevalay)\
**Post date:** [March 16, 2018, 1:17pm UTC](https://discuss.ipfs.tech/t/ipfs-download-button/2329/2 "2018-03-16T13:17:35Z")

</div>

hello cheerio,

you can see that (windows location is disable in website) but i think it can works : [https://jsbin.com/newoxoxiqu/1/edit?html,js,console,output](https://jsbin.com/newoxoxiqu/1/edit?html,js,console,output)

---

<div class="post-metadata">

**Author:** ![Cheerio](https://avatars.discourse-cdn.com/v4/letter/c/90db22/32.png) [@Cheerio](https://discuss.ipfs.tech/u/Cheerio)\
**Post date:** [March 20, 2018, 11:32am UTC](https://discuss.ipfs.tech/t/ipfs-download-button/2329/3 "2018-03-20T11:32:57Z")

</div>

Could not make it work…

What does this line of code stand for:  
let hash = document.querySelector(’#ipfsViewer’).dataset.ipfshash;

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![josselinchevalay](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/josselinchevalay/32/3078_2.png) [@josselinchevalay](https://discuss.ipfs.tech/u/josselinchevalay)\
**Post date:** [March 20, 2018, 11:51am UTC](https://discuss.ipfs.tech/t/ipfs-download-button/2329/4 "2018-03-20T11:51:32Z")

</div>

> **[Document.querySelector()](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector)**
>
> The Document method querySelector() returns the first Element within the document that matches the specified selector, or group of selectors. If no matches are found, null is returned.

so i get DOM element which has id attribute ipfsViewer after i need to get in dataset attribute ipfshash

regards
