jquery click on parent but not child

$(document).ready(function(){
    $(".header").click(function(){
        $(this).children(".children").toggle();
    });
   $(".header a").click(function(e) {
        e.stopPropagation();
   });
});

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
jquery parent div on click but not child div jquery on click parent except onc=e child jquery on click parent not child on child click click parent jquery jquery click event is not on parent but child jquery click parent child jquery click parent div not child jquery click only parent not child jquery click element but not child jquery click event only on child not parent click on parent not child jquery jquery click only child not parent jquery onclick parent or child jquery click child element not parent click on child element consider parent click in jquery jquery click on child but not parent trigger click on child element jquery not parent jquery click on element but not parent jquery on click parent or childre class trigger click stop jquery prevent click on parent element jquery prevent from calling all parents jquery click only chaild stop parent event jquery jquery click parent but not child click on child not parent JS how to click on button parent and not chilf js prevent inner element click trigger parent if click child element not parent jquery how to stop child getting triggered from parent HTML on click activating when child parent click trigger child click parent not child jquery stop parent click when child click event jquery jquery click event unless child is clicked click child not parent jquery onclick on parent but not child jquery click on parent but not child trigger click without parent jquery click listener jquery not on child javascript dont trigger click if child targeted jquery click element not child js prevent triiger on click when clicled in child jquery on click parent but not child jquery click child to parent element disable parent click event when child is clicked jquery click on child not parent clicking insde div trigger parent event too triggering event on parent trigger jquery event on a parent but not a child child trigger parent jquery jquery on click no parent
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