Title: jQuery function on modal close
Last modified: November 3, 2017

---

# jQuery function on modal close

 *  [tedbell2](https://wordpress.org/support/users/tedbell2/)
 * (@tedbell2)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/jquery-function-on-modal-close/)
 * I am trying to execute a function upon modal close. For some reason, I cannot
   get this function to execute. I am using a jQuery pages and posts plugin on the
   site and it is working correctly, because I can fire off a document loaded alert,
   so I know the jQuery injections are working fine.
 * Maybe it has something to do with the selector?
 * $(‘#wow-modal-window-1’).on(‘hidden.bs.modal’, function () {
    alert(“You got 
   it, pal!”); });
 * I have tried the id that I used in the wow-modal admin

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Wow-Company](https://wordpress.org/support/users/wpcalc/)
 * (@wpcalc)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/jquery-function-on-modal-close/#post-9649965)
 * Try use
    `$('#wow-modal-id-1')`
 *  Plugin Author [Wow-Company](https://wordpress.org/support/users/wpcalc/)
 * (@wpcalc)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/jquery-function-on-modal-close/#post-9649967)
 * Sorry, use selector
    `$('#wow-modal-close-1')`

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘jQuery function on modal close’ is closed to new replies.

 * ![](https://ps.w.org/modal-window/assets/icon-256x256.png?rev=1470847)
 * [Modal Window - create popup modal window](https://wordpress.org/plugins/modal-window/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/modal-window/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/modal-window/)
 * [Active Topics](https://wordpress.org/support/plugin/modal-window/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/modal-window/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/modal-window/reviews/)

## Tags

 * [jqery](https://wordpress.org/support/topic-tag/jqery/)

 * 2 replies
 * 2 participants
 * Last reply from: [Wow-Company](https://wordpress.org/support/users/wpcalc/)
 * Last activity: [8 years, 6 months ago](https://wordpress.org/support/topic/jquery-function-on-modal-close/#post-9649967)
 * Status: not resolved