// In my case, I used a button to activate this function:
function myFunction() {
window.location.href = 'index.html';
}
// In case I don't want any buttons or links to open a document
// I just want to open a document
window.open('file.extension');