Contact Form 7 dom events closing popup after sending?

Good time of day. Guys tell me in form. After a successful form submission I take aler notification, and are quite satisfied. But I have a form in popup, how to be still and close it? Very weak in js
mycustom_wp_footer function() {
<script type="text/javascript">
document.addEventListener( 'wpcf7submit', function( event ) {
 if ( '10771' == event.detail.contactFormId ) {
 alert( "Your message sent. Thank you." );
}, false );
June 10th 19 at 15:52
0 answer

Find more questions by tags WordPress