This looks awkward but when I'm trying to add any class or remove any class using jQuery it's not working, Instead of adding or removing class I tried with the alert window, in that case, it's working fine. Can anyone tell me why I'm not able to add or remove any class?
$('#sign').click(function(){ alert("I'm working"); $('#signup').ready(function(){ $(this).addClass('hidden'); }); }); This is the code I've tried and #sign is the id in Sidebar or navbar whatever. When I click on that link then it goes to the section with id #signup. In this section I want that class to add or remove.
$('#signup').ready(function(){and use$('#signup').toggleClass('hidden');. Complete Code is:$('#sign').click(function(){ $('#signup').toggleClass('hidden'); })readymake no sense in this context (no trigger)