Unfortunately, VS Code doesn't have such a feature. It would require it to detect what you want to do, and whether or not you want to write HTML Code in that JavaScript file.
However, there are two workarounds (afaik):
You could create a new temporary HTML file, write it there, then copy+paste it into the JS file (and escape end of strings etc.) OR
You could install GitHub Copilot (however this does send your code to GitHub servers)