0

I am learning JavaScript and facing an important problem. When I write JavaScript code directly in the browser console, it works perfectly. But when I put the same code inside my HTML file using a <script> tag, nothing happens when to run it.

There are no errors on the screen, and sometimes the console is also empty.
I am confused about why this happens and what I am doing wrong.

Can someone explain this in simple terms?

Parthik Dahima Changed status to publish