# modal pop-up is not triggering

**URL:** <https://community.hubspot.com/t/modal-pop-up-is-not-triggering/12227>\
**Category:** CMS Development\
**Created:** [January 8, 2019, 3:45pm UTC](https://community.hubspot.com/t/modal-pop-up-is-not-triggering/12227 "2019-01-08T15:45:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![angelicsanoy](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/angelicsanoy/32/27794_2.png) [@angelicsanoy](https://community.hubspot.com/u/angelicsanoy)\
**Post date:** [January 8, 2019, 3:45pm UTC](https://community.hubspot.com/t/modal-pop-up-is-not-triggering/12227/1 "2019-01-08T15:45:46Z")

</div>

Hi guys,

Can you help me why my modal is not working? This was working fine before [https://info.hollywoodbranded.com/testpurposeonly](https://info.hollywoodbranded.com/testpurposeonly)

$(document).ready(function(){  
$(‘button.button-modal’).click(function(){  
$(‘.modal-background’).css(“display”, “block”);  
});  
$(“.modal-close”).click(function(){  
$(‘.modal-background’).css(“display”, “none”);  
});  
});

---

<div class="post-metadata">

**Author:** ![JasonRosa](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jasonrosa/32/56551_2.png) [@JasonRosa](https://community.hubspot.com/u/JasonRosa)\
**Post date:** [January 8, 2019, 4:17pm UTC](https://community.hubspot.com/t/modal-pop-up-is-not-triggering/12227/2 "2019-01-08T16:17:33Z")

</div>

Hey @angelicsanoy I’m not seeing any HTML element with a class of “modal-background” in the source code of that page. I think the JS is working okay here from what I can see. I think the issue is the absence of the actual modal in that template. If you added in an HTML element with a class of “modal-background” it looks like the JS is working properly for it.

---

<div class="post-metadata">

**Author:** ![angelicsanoy](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/angelicsanoy/32/27794_2.png) [@angelicsanoy](https://community.hubspot.com/u/angelicsanoy)\
**Post date:** [January 8, 2019, 4:32pm UTC](https://community.hubspot.com/t/modal-pop-up-is-not-triggering/12227/3 "2019-01-08T16:32:54Z")

</div>

Hmmm.. it is added in the module

> **[Screenshot](https://prnt.sc/m4j02n)**
>
> Captured with Lightshot

Here;s the full module code.

```auto
<div class="main_page">
 <div class="column_menu">
 {% inline_rich_text field="primary_menu" value="{{ module.primary_menu }}" %}
 <button class="button-modal" type="button"> 
 {% inline_text field="Test" value="{{ module.Test }}" %}
 </button>
 </div>
 <div class="card">
 <div class="card-image">
 {% if module.image_card.src %}
	<img src="{{ module.image_card.src }}" alt="{{ module.image_card.alt }}" width="{{ module.image_card.width }}" height="{{ module.image_card.height }}">
{% endif %}
 </div>
 <div class="card-icon">
 {% inline_rich_text field="Card" value="{{ module.Card }}" %
 </div>

</div>

<div class="modal-background">
 <div class="modal">
 <button class="modal-close">X</button>
 <div class="modal-content">
{% form
	form_to_use="{{ module.Form.form_id }}"
	response_response_type="{{ module.Form.response_type }}"
	response_message="{{ module.Form.message }}"
	response_redirect_id="{{ module.Form.redirect_id }}"
	response_redirect_url="{{module.Form.redirect_url}}"
	gotowebinar_webinar_key="{{ module.Form.gotowebinar_webinar_key }}"
%}
 </div>
 </div>

```

---

<div class="post-metadata">

**Author:** ![JasonRosa](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jasonrosa/32/56551_2.png) [@JasonRosa](https://community.hubspot.com/u/JasonRosa)\
**Post date:** [January 8, 2019, 4:38pm UTC](https://community.hubspot.com/t/modal-pop-up-is-not-triggering/12227/4 "2019-01-08T16:38:46Z")

</div>

@angelicsanoy it looks like you might be missing a “}” after:

`{% inline_rich_text field="Card" value="{{ module.Card }}" %`

It should be this:

`{% inline_rich_text field="Card" value="{{ module.Card }}" %}`

Could you try adding that in and publishing your module afterwards to see if that helps?

---

<div class="post-metadata">

**Author:** ![angelicsanoy](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/angelicsanoy/32/27794_2.png) [@angelicsanoy](https://community.hubspot.com/u/angelicsanoy)\
**Post date:** [January 8, 2019, 4:57pm UTC](https://community.hubspot.com/t/modal-pop-up-is-not-triggering/12227/5 "2019-01-08T16:57:32Z")

</div>

Yayks. I’m so dumb. Thank u so much! 😄

---

<div class="post-metadata">

**Author:** ![JasonRosa](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jasonrosa/32/56551_2.png) [@JasonRosa](https://community.hubspot.com/u/JasonRosa)\
**Post date:** [January 8, 2019, 5:01pm UTC](https://community.hubspot.com/t/modal-pop-up-is-not-triggering/12227/6 "2019-01-08T17:01:42Z")

</div>

@angelicsanoy no worries! Happens all the time. Happy to hear that worked!
