0% found this document useful (0 votes)
2 views3 pages

Web scripting

The document provides an overview of Hypertext Markup Language (HTML), explaining its structure, tags, and how it is used to create web pages. It also discusses the integration of scripting languages like JavaScript to enhance HTML functionality. Additionally, practical steps are provided for creating a simple HTML webpage with embedded JavaScript.

Uploaded by

s89468414
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

Web scripting

The document provides an overview of Hypertext Markup Language (HTML), explaining its structure, tags, and how it is used to create web pages. It also discusses the integration of scripting languages like JavaScript to enhance HTML functionality. Additionally, practical steps are provided for creating a simple HTML webpage with embedded JavaScript.

Uploaded by

s89468414
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3

WEB SCRIPTING USING HYPERTEXT MARKUP LANGUAGE (HTML)

Hypertext Markup Language consists of tags that are interpreted by the web browser to display text
when the HTML file is opened on the screen by Web browser software.
A Tag is a special word enclosed between the less than and greater than (< >) symbols, and the browser
can interpret is as a command.
E.g., to start a HTML page, type; <HTML> at the top of the document.
The Markup tags tell the internet Browser that the file contains HTML-coded information. They also
define the various components of a WWW document such as tables, paragraphs, and lists.
Web pages are written using HTML in a text format that provides many features such as the capability
for in-line graphics, font control, and Hypertext links. A Hypertext link is a word or phrase in an
HTML-document that enables the user to jump to another Web page, or connect to another Web Server.
HTML is simple, doesn’t have the declaration part and control structures. In addition, it has many
limitations; hence, cannot be used alone when developing functional websites.
To add functionality to the HTML pages, some special blocks of code known as scripts are inserted in
HTML pages using scripting languages like JavaScript, VBScript and Hypertext Preprocessor.
A Script is a small program fragment, written in a different language other than HTML, but inserted into
the HTML program.
Most HTML tags have an opening tag and a closing tag. An opening tag is enclosed between
< >, while a closing tag is enclosed between </ >. The text that is to be displayed on the screen is
enclosed between an opening and closing tag.
HTML Tag Meaning
<HTML> </HTML> Marks the beginning and end of a HTML
document.
All other tags and text fall between these two
tags.
<HEAD></HEAD> Marks the header part of the document

<TITLE></TITLE> Gives the title of the web page.


The text between these tags will appear in the
title bar when the HTML document page is
running or browsed.
<BODY></BODY> Marks the body part of the document

<CENTER></CENTER> Centers text and objects on the web page

<B></B> Bolds the text on the web page, e.g., the


statement <B> Hello </B> will display the
word “Hello” in bold on the screen
<I></I> Italicize the text

<H1></H1> Sets the size of the text on the web page with H6
displaying the smallest and H1 the largest size

1
Creating a script using JavaScript
Before writing your HTML program with a script inserted, make sure you have the latest browser software installed on your computer.
e.g., if you’re using Internet Explorer, it should be version 5.0 and above.
1. Open Notepad, and type the following program.
2. Save your file on the desktop as Example.html, and then close the notepad. Notice that the icon to your file on the desktop looks like that of the default
web browser in your computer.
3. To view the web page, double-click the icon of the file Example.html on the desktop.
Explanation
<HTML> The tag <HTML> marks the beginning of the HTML document
<HEAD> Displays the text St. Joseph’s Girls High School in the title bar of
the running HTML document.
<TITLE> St. Joseph’s Girls High School </TITLE>
The title is written in the header section, i.e., between<HEAD> and
</HEAD> </HEAD> tags.
<BODY> It marks the beginning of the body section.
Anything between<BODY> and </BODY> will be executed and
displayed when the web page starts running.
<HI> <CENTER. <B> We are the world </B> </CENTER> This line will display the text We are the world on the screen. The
text will be large, i.e, size H1 and it will be centered on the screen. The
</HI> text will also be bolded.
<SCRIPT LANGUAGE = ‘JavaScript’> Marks the start point of the script.
The line LANGUAGE = ‘JavaScript’ tells the browser that the script
will be written in JavaScript language.
Document.Write (‘My name is Anthony’); The statement Document. Write tells the browser to write whatever is
in the brackets using JavaScript.
NB. In JavaScript, the end of a statement is marked by a semicolon (;).
Alert (‘congratulations for succeeding to run this script’); The word alert displays a message box on the screen with an OK button.
Clicking the button makes the message box to disappear.
The text in the brackets appears in the dialog box.
</SCRIPT> Closes the script
</BODY> </HTML> Marks the end of the body, and the HTML code.
1
Practical activity
1. Open a text editor program on your computer like Notepad or WordPad, and type the following program.

<HTML>
<HEAD>
<TITLE> Hello! This is my first webpage </TITLE>
</HEAD>
<BODY bgcolour = “Blue”>
<H3><CENTER><B>Hello World</B></CENTER></H3>
</BODY>
</HTML>
2. Save your file on the desktop as Webpage.html, and make sure that the Save As Type box reads “All Files” before clicking the Save button.
3. Close your text editor.
4. Double-click the icon of the file on the desktop to view the web page.
5. Change your background to blue, and save your program..

You might also like