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.
var status = $('#status').val(); //Not sure if it is a value/text $('#addlink').on('click', function (e) { if (status == 'Registered') { e.preventDefault(); // prevent the default action of anchor tag return false; } });