I am trying to put a link in JS, but I want to make it a file, but its only allowing a https. How do I make it a file?
JS:
function login() {
var username = document.getElementById("username").value;
var password = document.getElementById("password").value;
if (username == "admin" && password == "admin") {
window.location = "";
} else {
window.location = ""
}
}
2
Answers
By providing the path to the local file within the window.location assignment.
Here is your updated JS code:
Or you can refer to this site : https://www.w3schools.com/js/js_window_location.asp