Skip to content

Commit

Permalink
Create script.js
Browse files Browse the repository at this point in the history
  • Loading branch information
SudhanParajuli authored Oct 16, 2024
1 parent 0a1c7aa commit 723860c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const apkFileUrl = 'PU Civil Engineering Notes_1_1.0.apk';

document.getElementById('downloadBtn').addEventListener('click', function() {
downloadApkFile(apkFileUrl);
});

function downloadApkFile(url) {
const anchor = document.createElement('a');
anchor.style.display = 'none';
anchor.href = url;
anchor.download = 'Engineering.apk';


document.body.appendChild(anchor);

anchor.click();

document.body.removeChild(anchor);
}

0 comments on commit 723860c

Please sign in to comment.