else if(/\d/.test(code) && /[a-zA-Z]/.test(code)){window.location.href="confirmation.html";} code example
Example: javascript location.href
//example 1
document.getElementById("lbl_url").innerHTML = "Page location is " + window.location.href;
//example 2
var x = location.href;