- It is used to create a dynamic and interactive web page that gives Rich Experience to users.
- It is used to create cookies where the browser can store the user’s information.
<title>First JS Program</title>
After writing the script you should save it in a folder, say your file name will be “firstProgram”. Of course save the file as an HTML file, which means .html or .htm
Now the first thing is we put the script type. But it is not mandatory. If you just write the script tag it will work. The second thing is we write a syntax that starts with a document. write. It is a method to write anything on your HTML page. That means if you want to see any output from your script you can simply put it in the brackets of the document. write(). The final thing is we should put a semicolon after any statement to terminate it. When you write a single statement, it is mandatory. But when you write multiple statements it is a must.