Question: I have a event listener on a parent div, and i'd like it not to get fired on child div onclick as well.

I'm using jQuery for this, since i need the .on() being the element dynamically created, also the child div is dynamically created with an inline onclick="myFunction()".
When the onclick myFunction occurs in the child i don't want the parent .on(click) gets called again.

html:

```
    <div id="parent" class="areatext" onkeydown="checkR()">
    <div id="input" contenteditable="true" style="min-height:26px;" onkeyup="checkTyping()"></div>
    <div id="child" onclick="myFunction()"></div>
    </div>

```

js file 1:

```
$('#parent').on('click', function(event){
    $('#input').focus();
    console.log('parent clicked!');
    event.stopPropagation();
});

```

js file 2:

```
function myFunction(event){
   // actions
   // when this is clicked, #parent .on(click) also triggers, i don't want that
}

```

Answer: 
> 
> Instance is not set to an instance of an object.
> 
> 
> 

This is clearly saying that you are trying to execute an operation on something which is actually null.

That means your `StorageFileDisplay` and `SubFolderDisplay` lists in `MainFolderDisplay` object are null. So first you have to initialize these lists. You can do it as follows in the `MainFolderDisplay` class:

```
public class MainFolderDisplay
{
        public MainFolderDisplay()
        {
            StorageFileDisplay = new List<StorageFileDisplay>();
            SubFolderDisplay = new List<SubFolderDisplay>();
        }
        public int MainFolderId { get; set; }
        public string MainFolderName { get; set; }
        public int UserId { get; set; }

        public List<StorageFileDisplay> StorageFileDisplay { get; set; }
        public List<SubFolderDisplay> SubFolderDisplay { get; set; }
}

```
I think SubFolderDisplay or StorageFileDisplay lists are not instantiated. Ensure that before adding 

```
new List<SubFolderDisplay>()
new List<StorageFileDisplay>()

```