toggle one class add and one class remove same time and after click remove class add and add class remove jquery

$(".nav-link").click(function () {
  // If the clicked element has the active class, remove the active class from EVERY .nav-link>.state element
  if ($(this).hasClass("active")) {
    $(".nav-link").removeClass("active");
  }
  // Else, the element doesn't have the active class, so we remove it from every element before applying it to the element that was clicked
  else {
    $(".nav-link").removeClass("active");
    $(this).addClass("active");
  }
});

0
0
Pierre2 75 points

                                      function viewPastClass(id) {
        var class_date = $('#pastclassdata' + id).val();
        // alert(class_date);
        // $('#plclasses').hide();

        $.ajax({
            type: 'GET',
            url: '{{ url("/teacher/class/viewPastClass") }}',
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            },
            data: {
                'class_date': class_date,
            },
            success: function(result) {
                $('#plclasses').show(class_date);

            },
            error: function() {}
        });
    }

0
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
remove toggle effect in jquery toggle class add or remove jquery using id on toggle add and remove class property jquery on toggle jquery remove existing class jquery click toggle class add or remove add class remove class jquery toggle toggle class add and remove jq add class to element and remove from others sibllings jquery toggle class jquery class add or remove jquery addclass removeclass toggle class remove addclass with toggle jquery click add and remove class in same class jquery jquery js toggle add/remove class on click jquery js toggle add/remove class toggle remove element from html jquery how to onclick add and remove class on same class jquery jquery toggle remove content jquery toggle remove element toggle add and remove class jquery toggle add class remove class jquery can we use addclass and remove class instead of toogle class jquery add and remove class toggle in jquery jquery remove and add class toggle jquery toggle addclass remove class jquery syntax to toggle add or remove class on click element this add toggle class remove on other jquery add and remove class using toggle jquery toggle and replace class jquery jquery toggle class of id on click function to add and remove class jquery jquery click add e remove class button toggle class jquery Toggle class only on clicked element toggleclass active jquery jquery remove toggle jquery code to disable toggle onchange toggleClass click on a add class parrent div toggle jquery remove class then toggle class when link clicked toggle classjquery menu jquery click toggleclass remove class then toggle class jquery jquery toggle class on id .toggleclass jquery jquery add remove class together onclick how to addtoggle div in jq toggle add remove css property jquery add or remove class jquery img click add class toggle jquery jquery add or remove class remove toggle class jquery jquery remove class after toggleclass add jquery toggle class between two elements add and remove html by css using jquery how to remove a class every time its toggled how to remove and add class using jquery jquery click toggleclass jquery toggleclass with conditional add class remove class toggle query jquery Should toggle colors ON when they are OFF toggle remove class jquery class toggle get button toggle parrent name reverse toggle Class button jquery how to toggle/remove class on visible jquery removetoggle class remove class jquery on click add and remove class jquery if element has been clicked jquery replace class toggle toggle class of items c# jquery toggle button active toggle class how to toggle class in jquery toggle new div class on click toggle add remove class add and remove class in jquery on click toggleclass switch class jquery toggle removeClass add Class toogle class active toggleclass two classes $(this).parent('.finder_card').toggleClass('finder_active') jquery change css class on click toggle replace class jquery how to add remove class of this clicked button in jquery toggle class javascript and jquery jquery remove class and add from a element Using jQuery, remove class "highlight" from the third <p> tag. add remove class on toggle jquery jquery add and remove class is there a faster way to write addventlisten click toggle class on click remove add class jquery jquery add remove class remove class in jquery toggleclass two classes jquery jquery add class remove class on same button clcik jquery toggle class add remove .toggleclass() jquery select classes toggleclass add and remove class jquery add or remove class with jquery if has class thgen toogle jquery add remove classes how to remove class n div on click jquery toggle clASS two classes how to toggle class in jquery on click parent toggle class jquery toggleClass not applying new value add and remove class jquery on click onclick add and remove class using jquery how to make toggle class in jquary classToggle with hasClass jquery jquery add class and remove jquery class add remove howto use add remove and toggle in jquery jquery function toggleclass click remove class and add to the same how to toggle classes using query how to add new class and remove old class on toggle in jquery jquery stop toggle class button onclick remove class jquery click function toggle class jquery find toggleclass jquery class being added on second click jquery toggle add remove class onclick switch class jquery how to remove class from html tag jquery how to change toogle of a certain amount by class toggleclass at the same time functioning toggle one class add and one class remove same time and after click remove class add and add class remove jquery toggle active class jquery toggle classname jquery toggle class in jquery jquery toggle class if have no class then remove it remove or add class jquery jquery toggle class vs css jQuery toggle class between multiple elements toggle css class for parent element toggle class onclick jquery jquery click toggle class toggle to class jquery toggleclass javascript on click toggle class jquery jquery toggleClass if else toggleClass a or b in jquery toggle jquery active toggleclass jquery toggle class jquery toggle jquery remove others
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source