[Solved] how compare two variables which are inside two different functions i jquery?
[ad_1] You perhaps want to activate the content div based on the anchor clicked. Here are my updates : var selector=”.tabsclicked ul li”; $(selector).on(‘click’, function () { $(selector).removeClass(‘activenav’); $(this).addClass(‘activenav’); var linkshref = []; var clickedHref = $(this).find(‘a’).attr(‘href’); $(‘.tabsclicked ul li a’).each(function (i, el) { if ($(el).attr(‘href’) != clickedHref) { linkshref[i] = $(el).attr(‘href’); } }); for … Read more