<button> </button>

PURPOSE: A tag to make a push button. You can put content, like text or images inside it. Unlike the <input type="button"> tag, this tag does not require the company of the <form> tag surrounding it in order to display.

Below is a basic html document. The referenced html tag is in RED. All tags must have a start and a end tag. Most end tags have a / before the tags name, however there are a few that are done differently. The tags that end differently will be noted and highlighted. The order of the start and end tags is also very important to proper display of your page in a web browser.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title> The Page Title Goes Here </title>
</head>
<body>
<button>I am a button</button>
</body>
</html>


Here is the above button:


To make the above button perform a function, add the onclick function, this script opens a new window:

<button onClick="window.open('http://www.somewhere.com','mywindow','width=400,height=200')">Click Me</button>

Or you can make a image a button:

<button onClick="window.open('http://www.somewhere.com','mywindow','width=400,height=200')"><img src="something.gif" alt="Click Me" width="00" height="00"></button>


© Copyright 2001,2002 Southern Twilight    All rights reserved.

Back To HTML Examples