Javascript: Object Oriented Javascript Program

This entry is part 6 of 27 in the series Javascript Tutorial

If you only just want to output a simple text in the browser.

<!DOCTYPE html>
<html>
 <body>
 <script>
   document.write("Hello World!");
 </script>
 </body>
</html>

button

Here it will just output a simple text using document.write().

Javascript is an Object Oriented programming language.

For this example, the document is an object and the write is the method used by the Object to write out the text to the screen.

We can also format the output using HTML h1.

<!DOCTYPE html>
<html>
<body>
<script>
 document.write("<h1>Hello World!</h1>")
</script>
</body>
</html>

Try The Code

 

js_helllo

Series Navigation<< Javascript: First example explanations
Javascript: Basic HTML tags >>