Hello world on Javascript (Browser)

“Hello world” is actually very simple program on every programming language and it’s just writting to out stream or document or whatever simple two-words sentence – “Hello world”.
There are several ways to write hello world script for browser.

Optioin #1: Write in document:

<script type="text/javascript">
document.write("Hello World!");
</script>

Option #2: Shop standard browser message:

<script type="text/javascript">
alert("Hello World!");
</script>

Optioin #3: Write in browser’s title:

<script type="text/javascript">
document.title = "Hello World!";
</script>

Books to read

Leave a Reply

Your email address will not be published. Required fields are marked *