js如何实现点击元素跳转到指定页面?

js如何实现点击图中login.html文件中的input标签,然后跳转到图中的index.html这个页面?求解答。

img

使用js进行跳转:

// js
let submit = document.getElementById("submit")
submit.onclick = function(){
  window.loaction.href = "../index.html";
  // 或者
  window.open("../index.html");
}

//jq 
$("#submit").click(function() {
  window.loaction.href = "../index.html";
  // 或者
  window.open("../index.html");
})

 //通过class获取
    let a=document.querySelector(".aaa");
    a.addEventListener('click',function(){
        location.href="b.html"
    },false)