# Add download attribute to a button

**URL:** <https://community.wpbeaverbuilder.com/t/add-download-attribute-to-a-button/10226>\
**Category:** Snippets\
**Created:** [October 30, 2019, 9:34pm UTC](https://community.wpbeaverbuilder.com/t/add-download-attribute-to-a-button/10226 "2019-10-30T21:34:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pross](https://community.wpbeaverbuilder.com/user_avatar/community.wpbeaverbuilder.com/pross/32/883_2.png) [@pross](https://community.wpbeaverbuilder.com/u/pross)\
**Post date:** [October 30, 2019, 9:34pm UTC](https://community.wpbeaverbuilder.com/t/add-download-attribute-to-a-button/10226/1 "2019-10-30T21:34:20Z")

</div>

Assuming you’ve added _download_ as a custom class for the button module this js will add the attribute to force the download.

```
jQuery(document).ready(function(){
    jQuery( ".download a").attr( "download", "download" );
});
```
