In this post we are going to see simple hello world example. Below example writes “Hello world” to html document.
Hello world example hello world!
Statements inside <script> tag are executed by browser.
What is document?
This is object of html document loaded into browser. We have used write method to write content into html page. We will see all methods and properties in next post. Note: Don’t use document.write(“’); method in real life.. It will overwrite entire page with contents provided in the method. We have used for demo purpose. We will see other techniques to write content on html page.