2
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<span><</span>
<script>
let text = document.querySelector("span");
text.addEventListener("click", function(){
if (text.textContent == "<")
{
alert("é igual")
}
else
{
alert("não é igual")
}
});
</script>
</body>
</html>
The above example I am trying to compare if two values are equal in the case <
is equal to <
in case I had to return true
, but it’s returning to me false
, why?