How to determine if child was clicked in Jquery

Is there a ways in jQuery to tell which child was clicked if the onclick event was binded to the parent?

For instance:

  $('#daddy').click(function () {
    // if($("#son").isClicked()){return true;}
    //return false;

and the markup looks like:

<div id="daddy">
  <span id="son"></span>
  <span id="daughter"></span>


The event handler you pass to click will receive an event object as its first argument. The target of the event (i.e. the element that initiated the event) will be specified there.

Here's an example from the jQuery documentation:

<!DOCTYPE html>
span, strong, p { 
  padding: 8px; display: block; border: 1px solid #999;  }
  <script src=""></script>

<div id="log"></div>

$("body").click(function(event) {
  $("#log").html("clicked: " +;


You can use the to determine what was clicked:

  $('#daddy').click(function (e) {
      alert(; // The id of the clicked element

Here's a simple example.

This should be a different perspective at least:

$('#parent').on("click", function(evt) {
        if($.inArray(evt.currentTarget, $(this).children())){

check this demo out

$(function() {
    $('#parent').delegate('a', 'click', function(evt) {

Try this for an alternative

$('#daddy span').click(function () {
    var clicked = $(this).attr('id');
    if(clicked == "son"){
        return true;
    return false;

use to get the really clicked node:

$('#daddy span').on('click',function(event){
    if('BUTTON'){//Was clicked a button
    if('id'){//Was clicked #id

Need Your Help

How do I rename an attribute code in Magento?

magento attributes magento-1.4 entity-attribute-value

I want to rename an existing attribute's code to something else. The reason is because the attribute field is filled out for 300+ products and I don't want to have to re-import all of those just be...

tabindex in CSS

html css keydown

Is it possible to control tabindex with CSS and if yes, which browsers support it and on which elements?