best way to close webview

I tried to search the tutorial but could not find any, what is the best way to close the webview? Currently I am destroying the node completely and instantiating new web view when required but is there any better way to do it?

I followed this tutorial https://discuss.cocos2d-x.org/t/tutorial-interaction-and-hierarchy-of-webview-internal-pages/50026 , in this window.closeWebView() is used but could not find window.closeWebView in my project. Am I missing something?

there is nothing wrong in destroying and re-creating it when needed.
just make sure to destroy it properly if you are using >2.4.0.

Maybe you can check if WebView has been removed from Project → Project Settings → Module Config.