Home › Forums › JavaScript › jQuery: Select only the container, not the children? › Re: jQuery: Select only the container, not the children?
March 8, 2010 at 4:26 am
#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();
});
event.stopPropagation();
});
That should stop is from moving up and activating the box as well.