Jump to content

event.stopPropagation


jimfog

Recommended Posts

So far in my event handlers I never used the stopPropagation method to prevent bubbling.

I just use event.preverntDefault to prevent the default behavior and that's it.

 

The question is if it is really necessary to use it.

 

In my case I have a form with fieldsets inside of it(with click event handlers at the various submit buttons).

 

All of these have a parent element and the strange thing is that jquery attaches an event handler to it too(I cannot understand why jquery does that).

 

So the bubbling ends up at the parent element.

 

Thanks

Link to comment
Share on other sites

You ask questions like this a lot. It is necessary to use it if you want to use that behavior. If you don't want to use that behavior, then don't use it. If you don't know whether you want to use that behavior then research what it does.

 

You're the designer, it's your job to answer those questions.

Link to comment
Share on other sites

 

You're the designer, it's your job to answer those questions.

I maybe the designer but I do not have such an experience as to answer these questions with confidence.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...