I have an anchor element :
<a id="buyBtn" href="#" alt="Purchase" title="Buy now" data-enabled="true">
When it is clicked, I'm doing this:
enabled = $(this).data('enabled') == "true";
console.log(enabled);
However, the console shows false
. I was initially using ===
but that was giving false, so I moved to ==
.