To execute JavaScript in a browser you have two options — either put it inside a script element anywhere inside an HTML document , or put it inside an external JavaScript file (with a . js extension) and then reference that file inside the HTML document using an empty script element with a src attribute.
Read moreHow do I run a JavaScript file in CodePen?
To turn that off, open the JavaScript settings and UN-check the Auto Run? checkbox . When that setting is un-checked, you’ll see a Run button exposed that you need to explicitly press in order to re-run the JavaScript. Press it, and your JavaScript will run!
Read more