Create a Website
HTML
Dreamweaver
CSS Tutorial
JavaScript
FREE Hosting!
With every domain name
you register at DotEasy
you get FREE (no-ad)
one year hosting.
PLUS you get:
  • FREE Website Builder
  • FREE Blog
  • FREE Forum
  • FREE Photo Album
  • FREE Email Accounts
Get your FREE hosting today!
Home > JavaScript Tutorial
$0 Web Hosting

JavaScript How-to

Below is a classic example on how to use JavaScript to print text. I know this isn't very interesting, but it will be a good way to explain how JavaScript works and its basic syntax.

Example Code

The JavaScript below writes text JavaScript is Fun! to the page.

The Code

<script type="text/javascript">
<!--
document.write("JavaScript is Fun!");
//-->
</script>

The output is:
JavaScript is Fun!
Explanation of Code

Enjoy this tutorial?

1. Link to this page(copy/paste into your own website or blog):
2. Add this page to your favorite social bookmarks sites:
3. Add this page as your favorites. (Press Ctrl+D)