How do I set up Visual Studio Code to debug with breakpoints a JavaScript file which is part of an HTML file?
What I want to accomplish is demonstrated in this video, but it doesn't explain how to set it up:
https://www.youtube.com/watch?v=2ub2GCC8DHg&t=190s
Edit:
What the video shows: The video shows a JavaScript program (and the HTML file it's attached to) running in Microsoft Edge browser. The JavaScript is being debugged in VS Code with breakpoints. The browser pauses when a break point is reached. Then the browser resumes when the JavaScript resumes running after the break point.
What I've tried: I've installed VS Code and I'm able to debug standalone (not part of an HTML file) JavaScript with break points. When it comes to running JavaScript that's part of an HTML file, I can run the files in a web browser by pasting into it the file path of the HTML file. I'm also able to run the files with an extension called Live Preview by Microsoft. The JavaScript and HTML files run fine together without errors in my browser.
Where I'm stuck: There is no sync between the browser and VS Code. When I try to debug the JavaScript, it doesn't know it's part of the HTML. It is debugged as standalone, so there's an error because it needs the DOM object from the HTML file.