Skip to content

Instantly share code, notes, and snippets.

@w3bsme

w3bsme/index.js

Created Feb 11, 2021
Embed
What would you like to do?
File downloading via Vanilla JavaScript
setTimeout(() => {
const a = document.createElement('a');
a.download = 'file.txt';
a.href = 'data:text/plain;base64,SGVsbG8sIFdvcmxkIQ==';
a.click();
}, 5e3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment