SHARE
Facebook X Pinterest WhatsApp

HTML Goodies: Script Tip: Week 1

Written By
thumbnail
Joe Burns
Joe Burns
Jan 4, 2005

Tip One

JavaScript is a great computer language in that it is quite versatile and can be understood by the common Weekend Silicon Warrior. Here, we start off a series of tips to help you place JavaScript on your HTML pages.

We’ll start with the basics. JavaScript offers the user a series of what it calls “objects.” These are things that already exist without having to be created through scripting. This HTML page you’re looking at is, in my opinion, the most commonly used object. In JavaScript speak, the page is named “document.”

Okay, fine. You have an object, so what? Well, now you get to act upon it. These things that JavaScript uses to act upon “object” are called “methods.” You can always tell a method by its tail. Every method has this at the end: ().

     Those two parentheses denote the method and hold instructions on what should happen. For instance:

<SCRIPT LANGUAGE=”javascript”>
document.write(‘<FONT COLOR=green>Green Text</FONT>’)
</SCRIPT>

That script will produce this: Green Text

See what’s happening? The document is being acted upon by the method “write.” Inside the ( and the ) is what should be written to the page. In this case, green text.

You don’t get a much more simple JavaScript than the one above. All it does is use scripting to place text upon the page. Whatever is in between those parentheses is written to the page. It’s a very simple hierarchy statement.

Next Week: What do you mean by “hierarchy statement?”

     Do YOU have a Script Tip you’d like to share? How about suggesting a Script Tip to write about? I’d love to hear it. Write me at: webmaster@htmlgoodies.com


Learn to write your own JavaScripts with the
JavaScript Goodies!

You can find many other uses for JavaScript
on your Web pages here!

Recommended for you...

The Revolutionary ES6 Rest and Spread Operators
Rob Gravelle
Aug 23, 2022
Ahead of Time (AOT) Compilation in Angular
Tariq Siddiqui
Aug 16, 2022
Converting a JavaScript Object to a String
Rob Gravelle
Aug 14, 2022
Understanding Primitive Type Coercion in JavaScript
Rob Gravelle
Jul 28, 2022
HTML Goodies Logo

The original home of HTML tutorials. HTMLGoodies is a website dedicated to publishing tutorials that cover every aspect of being a web developer. We cover programming and web development tutorials on languages and technologies such as HTML, JavaScript, and CSS. In addition, our articles cover web frameworks like Angular and React.JS, as well as popular Content Management Systems (CMS) that include WordPress, Drupal, and Joomla. Website development platforms like Shopify, Squarespace, and Wix are also featured. Topics related to solid web design and Internet Marketing also find a home on HTMLGoodies, as we discuss UX/UI Design, Search Engine Optimization (SEO), and web dev best practices.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.