Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jquery click on parent but not child

$(".header").click(function(e){
     //Do nothing if .header was not directly clicked
     if(e.target !== e.currentTarget) return;

     $(this).children(".children").toggle();
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #jquery #click #parent #child
ADD COMMENT
Topic
Name
3+2 =