I can't succeed in calling JavaScript file from a HTML file.
test.html:
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<script src='http://code.jquery.com/jquery-3.2.1.min.js'</script>
<script type='text/javascript' src='test.js' </script>
<script>theTest(); </script>
</head>
<body>
<div id="myTest" style="position:relative;width:600px;height:400px;"></div>
</body>
</html>
test.js:
function theTest()
{
var they = 2;
console.log(they);
alert(they);
};
document.getElementById('myTest').innerHTML;
I am receiving:
ReferenceError: document is not defined