Question: I have a simple **eventHandler** in which a have a simple function with a **json** object. When a **click** event occurs I want to pass this json object data to that function to alert a message.

```
<script>
    $(document).ready(function () {
        $('#btnClick').on({                   
            click: function (event) {                   
                sayHello();
            },
            firstName: 'Raihan'
        });
        function sayHello(event)
        {
            alert('Yo ' + event.data.firstName);                
        }
    });
</script>

```

Answer: 
Maybe try this: 

```js
$(document).ready(function () {
    $('#btnClick').on({                   
        click: function (event) {
            event.data = {firstName: 'Raihan' };
            sayHello(event);
        }
    });
    function sayHello(event)
    {
        alert('Yo ' + event.data.firstName + "\r\n\r\n" + " Event data: " + JSON.stringify(event, null, 4));                
    }
});
```

```html
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>

<button id="btnClick">ClickMe</button>
```

JS Fiddle: <https://jsfiddle.net/qehm3svy/8/>
You have to pass the "event" argument to you sayhello function. Below is the code please try this.

```
<script>
    $(document).ready(function () {
        $('#btnClick').on({                   
            click: function (event) {                   
                sayHello(event);
            },
            firstName: 'Raihan'
        });
        function sayHello(event)
        {
            alert('Yo ' + event.data.firstName);                
        }
    });
</script>

```