Can someone explain me how to use document method in external .js file for Visual Studio Code?
What i do: I have an index.html file:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<table>
<tbody id="tbody"></tbody>
</table>
<script src="script.js"></script>
</body>
</html>
And script.js file:
var tbody = document.getElementById("tbody");
For running I select script.js file and start debugging (fn+F5) I get ReferenceError: document is not defined, see screenshot: http://prntscr.com/kfp60b
I understand that my browser is not opened and DOM is not exised yet, but how can I debug this method in external js file? how to run properly?
