Title: Programatically show modal
Last modified: July 19, 2018

---

# Programatically show modal

 *  Resolved [odedharel](https://wordpress.org/support/users/odedharel/)
 * (@odedharel)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/programatically-show-modal/)
 * Hello,
 * I’m trying to open the modal on page load. Tried to put the link in the dom `
   <a href="#omw-302" id="thank-you-modal" class="omw-open-modal">Open Modal</a>`,
   also tried to append it to body with JS and then I tried some JS on document 
   ready:
    `$( '#thank-you-modal' ).get(0).click();` `$( '#thank-you-modal' ).click();``
   $( '#thank-you-modal' ).trigger( 'click' );`
 * None of these options work, why?
 * Thanks
    Oded

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

 *  Plugin Author [oceanwp](https://wordpress.org/support/users/oceanwp/)
 * (@oceanwp)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/programatically-show-modal/#post-10521243)
 * Hello, it is not possible with this plugin, but I actually work on the Ocean 
   ELementor Widgets premium plugin and I have added a Modal widget where you will
   be able to show the modal on page load, exit window or on a button click.
 *  Thread Starter [odedharel](https://wordpress.org/support/users/odedharel/)
 * (@odedharel)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/programatically-show-modal/#post-10521501)
 * I see, thanks.
 *  Plugin Author [oceanwp](https://wordpress.org/support/users/oceanwp/)
 * (@oceanwp)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/programatically-show-modal/#post-10522703)
 * You’re welcome 🙂

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

The topic ‘Programatically show modal’ is closed to new replies.

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

## Tags

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

 * 3 replies
 * 2 participants
 * Last reply from: [oceanwp](https://wordpress.org/support/users/oceanwp/)
 * Last activity: [7 years, 10 months ago](https://wordpress.org/support/topic/programatically-show-modal/#post-10522703)
 * Status: resolved