# Trigger CTA Load on event

**URL:** <https://community.hubspot.com/t/trigger-cta-load-on-event/19376>\
**Category:** APIs & Integrations\
**Tags:** events\
**Created:** [March 11, 2020, 4:23pm UTC](https://community.hubspot.com/t/trigger-cta-load-on-event/19376 "2020-03-11T16:23:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonydov](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jonydov/32/99949_2.png) [@jonydov](https://community.hubspot.com/u/jonydov)\
**Post date:** [March 11, 2020, 4:23pm UTC](https://community.hubspot.com/t/trigger-cta-load-on-event/19376/1 "2020-03-11T16:23:59Z")

</div>

Is there a way to trigger the loading of a CTA?

I want to be able to manually (or if a another event is triggered), insert a CTA into a div.

Thanks!

---

<div class="post-metadata">

**Author:** ![WendyGoh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wendygoh/32/42320_2.png) [@WendyGoh](https://community.hubspot.com/u/WendyGoh)\
**Post date:** [March 12, 2020, 3:15am UTC](https://community.hubspot.com/t/trigger-cta-load-on-event/19376/2 "2020-03-12T03:15:31Z")

</div>

Hey @jonydov,

Are you referring to the HubSpot CTA? If so, I believe this is possible. Here’s an example code that works just fine for me:

```auto
 <div id="testdiv" style="display:none;">

// I place my HubSpot CTA embed code here

 </div> 
<button id="show">Show hidden div</button>

 <script>

 $(function() {
 $('#show').click(function() {
 $('#testdiv').show();

 });

});
 </script>

```

The event triggered here is the button id - show. Once that’s clicked, the #testdiv div will show. Hope this helps!

---

<div class="post-metadata">

**Author:** ![jonydov](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jonydov/32/99949_2.png) [@jonydov](https://community.hubspot.com/u/jonydov)\
**Post date:** [March 12, 2020, 9:56am UTC](https://community.hubspot.com/t/trigger-cta-load-on-event/19376/3 "2020-03-12T09:56:12Z")

</div>

Thanks for the reply!

I was wondering if the button can be actually generated on event, rather than simply show/hide it.

---

<div class="post-metadata">

**Author:** ![WendyGoh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wendygoh/32/42320_2.png) [@WendyGoh](https://community.hubspot.com/u/WendyGoh)\
**Post date:** [March 13, 2020, 1:43am UTC](https://community.hubspot.com/t/trigger-cta-load-on-event/19376/4 "2020-03-13T01:43:27Z")

</div>

Hey @jonydov,

I tried to play around with it but I do not believe it is possible to generate the button within a function. The best way to go about doing this is placing the button within a div.

---

<div class="post-metadata">

**Author:** ![jonydov](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jonydov/32/99949_2.png) [@jonydov](https://community.hubspot.com/u/jonydov)\
**Post date:** [March 14, 2020, 7:39pm UTC](https://community.hubspot.com/t/trigger-cta-load-on-event/19376/5 "2020-03-14T19:39:43Z")

</div>

Thank you!
