b=document.querySelector('.exportbutton') b.download='xxx.json' data=new Blob(['aaaaa']) b.href=window.URL.createObjectURL(data)