javascript code linked in an HTML file does not work in chrome console

I have a javascript code in separate file linked with an html file . When I run that html file on chrome,the console does not respond to that linked javascript file.

Here is the html code:

<!DOCTYPE html>
    <html lang="en" dir="ltr">
      <head>
        <meta charset="utf-8">
        <title></title>
        <script type="myscript.js">
    
        </script>
      </head>
      <body>
    
      </body>
    </html>

And this is the javascript code:

var x = 0;

while (x<5) {
  console.log('x is currenlty: '+5);
  console.log('adding 1 to x');

  x = x +1;
}

I expect the console to respond to print out the console log but on chrome nothing happens.
Can someone help me?

139 thoughts on “javascript code linked in an HTML file does not work in chrome console”

  1. Pingback: keto diet soda

Leave a Comment