I have this file js:
$('#btn_sa').click(function saluta(){
var username = document.getElementById("Name").value;
var password = document.getElementById("Password").value;
var blocco = $("<div></br>Ciao </div>");
console.log("funziona");
if(password === "errata"){
$(blocco).append(username);
blocco.appendTo(document.body);
document.getElementById("btn_sa").disabled = true;
}else{
$(blocco).css({
"color" : "red",
"font-size" : "10px"
});
$(blocco).text("Password Errata");
blocco.appendTo(document.body);
}
});
and this button in the html file:
<button id = "btn_sa">LOGIN</button>
when I run the html, it import the file js, but when I click on the button nothing happens.
can someone help me?