- Forums
- Javascipt
- This Is A Very Simple Hello World Javascript Code Example
this is a simple hello world javascript script with code to show you how to create and make a simple hello world script using javascript for your broswer on the web [806], Last Updated: Sat May 18, 2024
wallpaperama
Thu Sep 25, 2008
0 Comments
1721 Visits
ok, so you want to start making javascript script. javascript is really fun because you can do alot of cool effects.
lets start my creating our first script.
i am using windows xp to write this tutorial, so open a blank notepad and copy and paste the following code into a blank notepad document
NOTE: if you dont have notepad, be sure to use an ascii text editor. dont use wordpad or a word process like word.exe, these programs format the text, and we dont want that. all microsoft windows come wint notepad, so you shouldn't use anything else.
JAVASCRIPT CODE:
<script language="javascript" type="text/javascript">
<!--
alert('Hello World Popup');
document.write('Hello Wallpaperama World! I wrote this message using javascript');
//-->
</script>
once you have copied and paste the code above, save it as:
hello-world.htmlnow open
hello-world.html with your browser, in my case, i am using internet explorer, but you can also use firefox if you prefer.
that's it, you will see your first script, the
alert() function created the pop up you saw earlier, and the text on the browser was created by the
document.write() function.
hope that helps
DEMO: