# Guide: Trigger Click Events with jQuery

**URL:** <https://forum.freecodecamp.org/t/guide-trigger-click-events-with-jquery/18326>\
**Category:** freeCodeCamp Contributors\
**Tags:** guide\
**Created:** [July 7, 2016, 10:59pm UTC](https://forum.freecodecamp.org/t/guide-trigger-click-events-with-jquery/18326 "2016-07-07T22:59:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![camperbot](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/camperbot/32/18364_2.png) [@camperbot](https://forum.freecodecamp.org/u/camperbot)\
**Post date:** [July 7, 2016, 10:59pm UTC](https://forum.freecodecamp.org/t/guide-trigger-click-events-with-jquery/18326/1 "2016-07-07T22:59:25Z")

</div>

APIs - or Application Programming Interfaces - are tools that computers use to communicate with one another.

`$(document).ready()` This function makes it so all code inside of it only runs once our page loads.

Inside that you can add any function or code, for this particular Challenge you need to add a click handler:

```javascript
$("#getMessage").on("click", function(){
  //Custom code here
});

```

This will create a function so when the element with id `getMessage` is clicked, the custom function will be run.

---

<div class="post-metadata">

**Author:** ![anon52159105](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@anon52159105](https://forum.freecodecamp.org/u/anon52159105)\
**Post date:** [August 6, 2017, 11:38pm UTC](https://forum.freecodecamp.org/t/guide-trigger-click-events-with-jquery/18326/2 "2017-08-06T23:38:06Z")

</div>

Closed on August 6, 2017, 11:38pm UTC


