JSON freeCodeCamp

What is trigger Click events and how to use it in JSON?

Those are two separate things.

A click event is how your JavaScript (or JQuery) can tell that the user has clicked something with the mouse. It is a piece of code that will run when a click happens in a place the you specify.


JSON is a file/data format that is commonly used to transfer data. Often, if you call out to other web sites to get data, it will be transferred in a JSON file, using an AJAX call (or .getJSON).

I guess to get to your question more specifically, yes, I guess they could be combined. You could wait for the user to click on a button and that event causes you JavaScript to go out and get a JSON from another web site. So, yes, they could be paired together, but they don’t have to be. You can have a click event that has nothing to do with JSON and you can go and get a JSON without ever having a click.