form tag
legend tag
label tag
input tag
TAG: fieldset
<fieldset> ... </fieldset>
The
fieldset
tag is used to group related
form
elements together with a caption and labels. The caption is created using the
legend
tag. One or more labels are created using the
label
tag. The browser is supposed to render the appearance of the caption and labels in a special manner.
The separate closing tag is mandatory.
Attributes and Events
class
dir
id
lang
onclick
ondblclick
onkeydown
onkeypress
onkeyup
onmousedown
onmousemove
onmouseout
onmouseover
onmouseup
style
title
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="eng">
<head>
<title>DevGuru XHTML fieldset Tag Example</title>
</head>
<body>
<form>
<
fieldset
>
<legend>Please Enter Your Name</legend>
<label for="firstname">First Name</label><input type="text" id="firstname" />
<br />
<label for="lastname">Last Name</label><input type="text" id="lastname" />
<
/fieldset
>
</form>
</body>
</html>
Output:
Please Enter Your Name
First Name
Last Name
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information