I am using jQuery to grab the text of a button and want to compare that text to a letter in a string. I haven't been able to get it to return true. Below is just a simplified example of what I am trying to do.
the first console log returns "a" "string" the second console log is taking an element that has the text of the letter a in it an returns "a" "string"
even though it seems they are the exact same, when I check if they are equal using a boolean it returns false.
<div class="button">
<p>a</p>
</div>
console.log (`a`, typeof `a`)
console.log ($element.text(), typeof $element.text())
console.log('a' == $element.text());
Can anyone tell me why this is happening?