# jQuery plugin click event children

**URL:** <https://forum.shopware.com/t/jquery-plugin-click-event-children/47224>\
**Category:** Programmierung\
**Created:** [1. August 2017 um 12:22 UTC](https://forum.shopware.com/t/jquery-plugin-click-event-children/47224 "2017-08-01T12:22:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![langnickel](https://avatars.discourse-cdn.com/v4/letter/l/3ec8ea/32.png) [@langnickel](https://forum.shopware.com/u/langnickel)\
**Post date:** [1. August 2017 um 12:22 UTC](https://forum.shopware.com/t/jquery-plugin-click-event-children/47224/1 "2017-08-01T12:22:03Z")

</div>

Ich kann ja bei einem Shopware jQuery Plugin mit&nbsp;

```
me._on(me.$el, 'click', function(event) { .... }));

```

auf einen Klick auf $el reagieren. Wie kann ich aber nun einen click listener für (dynamisch erzeugte) child elemente von $el anlegen?

sprich sowas in der Art:

```
jQuery('.parent').on('click', '.node', function(e) { ... }));

// oder alternativ falls obiges nicht möglich
jQuery('.parent .node').on('click', function(e) { ... }));

```

Vorläufig benutz ich folgenden code, aber weiß nicht ob das sooo gut it.

```
me.$el.on('click', '.node', function(e) {
    e.preventDefault();
    /* .. do something .. */
}.bind(me));

```

&nbsp;
