Joris Mans Joris Mans - 1 year ago 90
HTML Question

Which div to programmatically click to close bootstrap modal

I am writing tests for my Bootstrap 3.x webapp using Nightwatch. All is working fine, but I would like to add the "close modal by clicking somewhere next to it" in one of my tests. I don't seem to be able to identify the html element that's supposed to receive the click event however.

Can anyone help me with this?


Answer Source

The background is a div with class .modal-backdrop. According to the docs: "...generates a .modal-backdrop to provide a click area for dismissing shown modals when clicking outside the modal."

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download