I have created a list which when I select highlights but I only want one item at time to highlight – also as the item is highlighted I need to enable the button – example below:
$('#sn-list li a').click(function () {
$(this).parent('li').toggleClass('highlight');
if (!currentPage.parent().hasClass('highlight')) {
$('#tabulation_button').removeProp("disabled");
alert('hello');
}
else {
$('#tabulation_button').prop("disabled", "disabled");
}
});
Replace
with
Secondly I don’t see where this variable is declared
currentPageThis makes no sense in the current context as these are not defined in the code that you have mentioned..
Check Fiddle