C & G web

Example - customised HTML document

Using JavaScript a Dynamic page can be built from user input.

The HTML/JavaScript

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
	 <title>Script to create a customised HTML document</title>
</head>

<body>

<h1>Script to create a customised HTML document</h1>

<script language="JavaScript">
<!-- 
first = prompt("Enter your first name.");
last = prompt("Enter your last name.");
title = prompt("Enter a page title.");
document.write("<h2>" + title + "</h2>");
document.write("<b>By " + first + " " + last + "</b>")
// -->
</script>
<p>This page is under construction.
</body>
</html>

Previous page...

Back to Top of Page

Computeach International Ltd

Christopher Ward London Limited

Christopher Ward London Limited