in Education by

I tested out the script below in jsfiddle and it works fine, can someone guide me how to fix it? This is the url that I need it working in, the wizard style menu at the top right should should have each item set to active when clicked and then removed when another menu item is clicked: http://morxmedia.com/clients/temp/45p/index_vertical.html Here is the code I am using for this: $('.wizard-steps div').click(function(e) { e.preventDefault(); $('a').removeClass('active'); $(this).addClass('active'); }); JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

Please log in or register to answer this question.

1 Answer

0 votes
by

You are binding the click event to div elements when you should bind them to a elements like so $(document).ready(function(){ $('.wizard-steps > div > a').click(function(e) { e.preventDefault(); $('a').removeClass('active'); $(this).addClass('active'); }); });

Related questions

0 votes
asked Feb 21, 2022 in Education by JackTerrance
0 votes
asked May 13, 2022 in Education by JackTerrance
0 votes
asked Oct 11, 2021 in Education by JackTerrance
...