I'm trying to do a basic validation in pure javascript.
It works as follows;
I have <h1>
where the user profile is informed and I need to verify the text, as an example:
<h1 class="perfil-usuario">SISTEMA<h1>
And I also have the condition:
<script>
var perfilSistema = document.querySelector(".perfil-sistema");
if (perfilSistema == 'SISTEMA' ) {
window.location = "index.html";
}
</script>
But it is not directing the user to the index when it receives SYSTEM. Grateful to whom to help.