I want to show a message on a label
in a login that if the user has not entered any data that shows a message that you have not entered anything in that tag this is the code that I am using:
(function () {
"use strict";
var iniciar = document.getElementById('iniciarSesion');
iniciar.addEventListener('click', function () {
alert();
var user = document.getElementById('txtUsuario').value,
pass = document.getElementById('txtPass').value,
msg = "";
if (user !== "" && pass !== "") {
} else {
msg = "alaal";
document.getElementById('mensaje').value = msg;
}
});
}());
I know I need AJAX and that, but first I want you to show me the message just to get started.
This is the login code
I'm just starting in JavaScript