On page load, I am checking to see if a person is registered. If he is then, I will enable a link otherwise disable the link.
I tried the following , but it doesnt work.
Try this, if user is register then enable the link by adding href, if not then disable by removing the href attribute.
Just set the status
to some string
before executing this code.
var href = $('#addlink').attr('href');
if(status == 'Registered'){
$('#addlink').attr('href', href);
} else{
$('#addlink').removeAttr('href');
}
Check here.