I want the user to log in to my page, javascript checks his profile on the system, and if the profile is empty, it goes to the home page.
It's simple, I'm trying this code here, but it's not working right:
<script>
var perfil = document.querySelector('#perfil').textContent;
if (perfil = ''){
window.location = "../index.php";
}
</script>
That's all I need to do, if profile is empty, then go to index, but it's not working that way there, how can I do it?
My html