I have a simple jQuery script that I'm trying to build upon but I can't get the href string comparison to return true:
<a class="test" href="/Services/Cloud-Hosting">Click Me</a>
My script is as follows:
$('.test').click(function() {
if ($(this).href == "/Services/Cloud-Hosting") {
alert('hi');
}
else {
alert('no');
}
});
I keep getting the alert of 'no' even thought the hrefs are the same. What am I missing?