Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript jQuery: Select only the container, not the children? Re: jQuery: Select only the container, not the children?

#72133
noahgelman
Participant

Yes, there is a way, its called stopProgagation(). When you click the link, the links activate, but technically you clicked on the box as well, so that is why you are getting both reactions. Here’s an example on how to fix it:

Code:
$(“a.yourlink”).click(function(event){
event.stopPropagation();
});

That should stop is from moving up and activating the box as well.