How to hide Contact Form 7 after successful send

As we know that contact form 7 is built up using different action and filter hooks.Here, we need to use JavaScript action hook “on_sent_ok” through which we can hide the contact form 7 as on_sent_okĀ  hook is being called after the form is successfully submitted.There is option to add JavaScript code in Additional Settings form