Question: I have this code:

```
$(document)
.on(
  "click", 
  "#target", 
  function() { 
    //SOME_CODE
  }
);

```

And now I have to bind **`//SOME_CODE`** to another event after some specific code that will have to be executed only on this second event:

```
$(document)
.on(
  "click",
  "#anotherTarget",
  function() {
    //SOME_OTHER_CODE
    //SOME_CODE
  }
);

```

How can I call **`//SOME_CODE`** without copy-and-paste it and **without specify a function on top of both events**?

I've tried with this code:

```
$(document)
.on(
  "click.somecode", 
  "#target", 
  function() { 
    //SOME_CODE
  }
);

$(document)
.on(
  "click",
  "#anotherTarget",
  function() {
    //SOME_OTHER_CODE
    $(document).trigger("click.somecode");
  }
);

```

But the **`//SOME_CODE`** is not executed.

Answer: 
Just fire a click event for the target?

```
$(document)
.on(
  "click",
  "#anotherTarget",
  function() {
    //SOME_OTHER_CODE
    $("#target").click();
  }
);

```
try this

```
$("#target").trigger('click')

```

[see fiddle demo](http://jsfiddle.net/ME2Xj/)