run js in html code example
Example 1: hello world javascript
// Output Hello World! in the console.
console.log("Hello World!");
Example 2: javascript hello world
I would do something like this:
<script>
alert("Hello World!");
</script>
Example 3: call js script in html
<script src="file1.js" type="text/javascript"></script>
<script src="file2.js" type="text/javascript"></script>