Create HTML file and include JavaScript inside it

 Create HTML file and include JavaScript inside it

It's easy to create an HTML file and include JavaScript in it. Let's see how this is done.

First open Notepad using run(CTRL+r) key or Start and run.

Save the file and give it a name of test.html or use your own filename instead of test.

Inside it, copy and paste this code. Look at the video for explanations.


<!DOCTYPE html>
<html>
<head>
<title>JavaScript Section 2 - Built in function console.log</title>
</head>
<body>

<script> // This is the opening script tag. This tells browser that this is JS code.
console.log("Doers!");
</script>

</body>
</html>

As you can see this is a simple example of how to include JS in HTML file. If you have any doubts please leave a comment.




Post a Comment

0 Comments

React