Most JavaScript runs in a web page - you attach the JavaScript into the web page using the HTML <script> tag.
See
http://javascriptexample.net/basics01.php for a basic example of how to attach JavaScript to a web page so that it runs when the web page loads.